mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
DECKGL integration - Phase 1 (#3771)
* DECKGL integration Adding a new set of geospatial visualizations building on top of the awesome deck.gl library. https://github.com/uber/deck.gl While the end goal it to expose all types of layers and let users bind their data to control most props exposed by the deck.gl API, this PR focusses on a first set of visualizations and props: * ScatterLayer * HexagonLayer * GridLayer * ScreenGridLayer * Addressing comments * lint * Linting * Addressing chri's comments
This commit is contained in:
committed by
Grace Guo
parent
1c545d3a2d
commit
3a8af5d0b0
@@ -0,0 +1,39 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
|
||||
import FixedOrMetricControl from
|
||||
'../../../../javascripts/explore/components/controls/FixedOrMetricControl';
|
||||
import SelectControl from
|
||||
'../../../../javascripts/explore/components/controls/SelectControl';
|
||||
import TextControl from
|
||||
'../../../../javascripts/explore/components/controls/TextControl';
|
||||
import ControlHeader from '../../../../javascripts/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
value: { },
|
||||
};
|
||||
|
||||
describe('FixedOrMetricControl', () => {
|
||||
let wrapper;
|
||||
let inst;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<FixedOrMetricControl {...defaultProps} />);
|
||||
inst = wrapper.instance();
|
||||
});
|
||||
|
||||
it('renders a OverlayTrigger', () => {
|
||||
const controlHeader = wrapper.find(ControlHeader);
|
||||
expect(controlHeader).to.have.lengthOf(1);
|
||||
expect(wrapper.find(OverlayTrigger)).to.have.length(1);
|
||||
});
|
||||
|
||||
it('renders a TextControl and a SelectControl', () => {
|
||||
const popOver = shallow(inst.renderPopover());
|
||||
expect(popOver.find(TextControl)).to.have.lengthOf(1);
|
||||
expect(popOver.find(SelectControl)).to.have.lengthOf(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
import { OverlayTrigger, Label } from 'react-bootstrap';
|
||||
|
||||
import ViewportControl from
|
||||
'../../../../javascripts/explore/components/controls/ViewportControl';
|
||||
import TextControl from
|
||||
'../../../../javascripts/explore/components/controls/TextControl';
|
||||
import ControlHeader from '../../../../javascripts/explore/components/ControlHeader';
|
||||
|
||||
const defaultProps = {
|
||||
value: {
|
||||
longitude: 6.85236157047845,
|
||||
latitude: 31.222656842808707,
|
||||
zoom: 1,
|
||||
bearing: 0,
|
||||
pitch: 0,
|
||||
},
|
||||
};
|
||||
|
||||
describe('ViewportControl', () => {
|
||||
let wrapper;
|
||||
let inst;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<ViewportControl {...defaultProps} />);
|
||||
inst = wrapper.instance();
|
||||
});
|
||||
|
||||
it('renders a OverlayTrigger', () => {
|
||||
const controlHeader = wrapper.find(ControlHeader);
|
||||
expect(controlHeader).to.have.lengthOf(1);
|
||||
expect(wrapper.find(OverlayTrigger)).to.have.length(1);
|
||||
});
|
||||
|
||||
it('renders a Popover with 5 TextControl', () => {
|
||||
const popOver = shallow(inst.renderPopover());
|
||||
expect(popOver.find(TextControl)).to.have.lengthOf(5);
|
||||
});
|
||||
|
||||
it('renders a summary in the label', () => {
|
||||
expect(wrapper.find(Label).first().render().text()).to.equal('6° 51\' 8.50" | 31° 13\' 21.56"');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user