mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
feat: upgrade @superset-ui to v0.12 (#183)
* build: update dependencies * feat: replace payload with queryData * feat: replace payload with queryData * fix: rename hooks * fix: types from query package * fix: more typings * docs: update readme * fix: import query * fix: change NOOP to const * fix: update dependency versions
This commit is contained in:
parent
3441da080f
commit
9e47ea8a96
@ -41,15 +41,16 @@
|
||||
"devDependencies": {
|
||||
"@superset-ui/build-config": "^0.1.0",
|
||||
"@superset-ui/commit-config": "^0.0.9",
|
||||
"@superset-ui/chart": "^0.11.14",
|
||||
"@superset-ui/chart-composition": "^0.11.9",
|
||||
"@superset-ui/color": "^0.11.9",
|
||||
"@superset-ui/connection": "^0.11.10",
|
||||
"@superset-ui/core": "^0.11.10",
|
||||
"@superset-ui/dimension": "^0.11.10",
|
||||
"@superset-ui/number-format": "^0.11.5",
|
||||
"@superset-ui/time-format": "^0.11.5",
|
||||
"@superset-ui/translation": "^0.11.9",
|
||||
"@superset-ui/chart": "^0.12.1",
|
||||
"@superset-ui/chart-composition": "^0.12.1",
|
||||
"@superset-ui/color": "^0.12.1",
|
||||
"@superset-ui/connection": "^0.12.0",
|
||||
"@superset-ui/core": "^0.12.0",
|
||||
"@superset-ui/dimension": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.1",
|
||||
"@superset-ui/query": "^0.12.2",
|
||||
"@superset-ui/time-format": "^0.12.1",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"@types/react": "^16.8.8",
|
||||
"core-js": "^3.0.1",
|
||||
"csstype": "^2.6.3",
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="calendar"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,10 +33,10 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { height, formData, payload, datasource } = chartProps;
|
||||
const { height, formData, queryData, datasource } = chartProps;
|
||||
const {
|
||||
cellPadding,
|
||||
cellRadius,
|
||||
@ -36,7 +36,7 @@ export default function transformProps(chartProps) {
|
||||
|
||||
return {
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
cellPadding,
|
||||
cellRadius,
|
||||
cellSize,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="chord"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,9 +32,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { yAxisFormat, colorScheme } = formData;
|
||||
|
||||
return {
|
||||
colorScheme,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
height,
|
||||
numberFormat: yAxisFormat,
|
||||
width,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="country-map"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,9 +33,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { linearColorScheme, numberFormat, selectCountry } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
country: selectCountry,
|
||||
linearColorScheme,
|
||||
numberFormat,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="event-flow"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,8 +32,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,9 @@
|
||||
import { cleanEvents, TS, EVENT_NAME, ENTITY_ID } from '@data-ui/event-flow';
|
||||
|
||||
export default function transformProps(chartProps) {
|
||||
const { formData, payload, width, height } = chartProps;
|
||||
const { formData, queryData, width, height } = chartProps;
|
||||
const { allColumnsX, entity, minLeafNodeEventCount } = formData;
|
||||
const { data } = payload;
|
||||
const { data } = queryData;
|
||||
|
||||
const hasData = data && data.length > 0;
|
||||
if (hasData) {
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="force-directed"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,7 +32,7 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { charge, linkLength } = formData;
|
||||
|
||||
return {
|
||||
charge,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
height,
|
||||
linkLength,
|
||||
width,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="heatmap"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -34,9 +34,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const {
|
||||
bottomMargin,
|
||||
canvasImageRendering,
|
||||
@ -42,7 +42,7 @@ export default function transformProps(chartProps) {
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
bottomMargin,
|
||||
canvasImageRendering,
|
||||
colorScheme: linearColorScheme,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="histogram"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -36,9 +36,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, linkLength, normalized, globalOpacity, xAxisLabel, yAxisLabel } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
binCount: parseInt(linkLength, 10),
|
||||
colorScheme,
|
||||
normalized,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="horizon"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,8 +33,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, formData, payload } = chartProps;
|
||||
const { width, formData, queryData } = chartProps;
|
||||
const { horizonColorScale, seriesHeight } = formData;
|
||||
|
||||
return {
|
||||
colorScale: horizonColorScale,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
seriesHeight: parseInt(seriesHeight, 10),
|
||||
width,
|
||||
};
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="iframe"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,8 +32,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="map-box"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -36,8 +36,8 @@
|
||||
"viewport-mercator-project": "^6.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,12 @@
|
||||
import supercluster from 'supercluster';
|
||||
import { DEFAULT_POINT_RADIUS, DEFAULT_MAX_ZOOM } from './MapBox';
|
||||
|
||||
const NOOP = () => {};
|
||||
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, onError, payload, setControlValue = () => {} } = chartProps;
|
||||
const { bounds, geoJSON, hasCustomMetric, mapboxApiKey } = payload.data;
|
||||
const { width, height, formData, hooks, queryData } = chartProps;
|
||||
const { onError = NOOP, setControlValue = NOOP } = hooks;
|
||||
const { bounds, geoJSON, hasCustomMetric, mapboxApiKey } = queryData.data;
|
||||
const {
|
||||
clusteringRadius,
|
||||
globalOpacity,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="markup"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -31,8 +31,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -17,9 +17,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { height, payload, formData } = chartProps;
|
||||
const { height, queryData, formData } = chartProps;
|
||||
const { vizType } = formData;
|
||||
const { theme_css: cssFiles, html } = payload.data;
|
||||
const { theme_css: cssFiles, html } = queryData.data;
|
||||
|
||||
return {
|
||||
cssFiles,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="paired-t-test"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,8 +33,8 @@
|
||||
"reactable-arc": "0.15.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { formData, payload } = chartProps;
|
||||
const { formData, queryData } = chartProps;
|
||||
const { groupby, liftvaluePrecision, metrics, pvaluePrecision, significanceLevel } = formData;
|
||||
|
||||
return {
|
||||
alpha: significanceLevel,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
groups: groupby,
|
||||
liftValPrec: parseInt(liftvaluePrecision, 10),
|
||||
metrics,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="parallel-coordinates"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,8 +32,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const {
|
||||
includeSeries,
|
||||
linearColorScheme,
|
||||
@ -31,7 +31,7 @@ export default function transformProps(chartProps) {
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
includeSeries,
|
||||
linearColorScheme,
|
||||
metrics: metrics.map(m => m.label || m),
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="partition"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,10 +33,10 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, datasource, formData, payload } = chartProps;
|
||||
const { width, height, datasource, formData, queryData } = chartProps;
|
||||
const {
|
||||
colorScheme,
|
||||
dateTimeFormat,
|
||||
@ -37,7 +37,7 @@ export default function transformProps(chartProps) {
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
dateTimeFormat,
|
||||
equalDateSize,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="pivot-table"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,8 +33,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ function PivotTable(element, props) {
|
||||
const container = element;
|
||||
const $container = $(element);
|
||||
|
||||
// payload data is a string of html with a single table element
|
||||
// queryData data is a string of html with a single table element
|
||||
container.innerHTML = html;
|
||||
|
||||
const cols = Array.isArray(columns[0]) ? columns.map(col => col[0]) : columns;
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { height, datasource, formData, payload } = chartProps;
|
||||
const { height, datasource, formData, queryData } = chartProps;
|
||||
const { groupby, numberFormat } = formData;
|
||||
const { columnFormats, verboseMap } = datasource;
|
||||
|
||||
return {
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
columnFormats,
|
||||
numGroups: groupby.length,
|
||||
numberFormat,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="rose"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,10 +33,10 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, dateTimeFormat, numberFormat, richTooltip, roseAreaProportion } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
dateTimeFormat,
|
||||
numberFormat,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="sankey-loop"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
||||
|
@ -33,9 +33,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload, margin } = chartProps;
|
||||
const { width, height, formData, queryData, margin } = chartProps;
|
||||
const { colorScheme } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
margin,
|
||||
};
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="sankey"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,9 +33,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
};
|
||||
}
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="sunburst"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -32,9 +32,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, metric, secondaryMetric } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
metrics: [metric, secondaryMetric],
|
||||
};
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="table"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -34,9 +34,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ const propTypes = {
|
||||
|
||||
const formatValue = getNumberFormatter(NumberFormats.INTEGER);
|
||||
const formatPercent = getNumberFormatter(NumberFormats.PERCENT_3_POINT);
|
||||
function NOOP() {}
|
||||
const NOOP = () => {};
|
||||
|
||||
function TableVis(element, props) {
|
||||
const {
|
||||
|
@ -18,7 +18,9 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { height, datasource, filters, formData, onAddFilter, payload } = chartProps;
|
||||
const { height, datasource, initialValues, formData, hooks, queryData } = chartProps;
|
||||
const { onAddFilter = () => {} } = hooks;
|
||||
|
||||
const {
|
||||
alignPn,
|
||||
colorPn,
|
||||
@ -32,7 +34,7 @@ export default function transformProps(chartProps) {
|
||||
timeseriesLimitMetric,
|
||||
} = formData;
|
||||
const { columnFormats, verboseMap } = datasource;
|
||||
const { records, columns } = payload.data;
|
||||
const { records, columns } = queryData.data;
|
||||
|
||||
const processedColumns = columns.map(key => {
|
||||
let label = verboseMap[key];
|
||||
@ -59,7 +61,7 @@ export default function transformProps(chartProps) {
|
||||
alignPositiveNegative: alignPn,
|
||||
colorPositiveNegative: colorPn,
|
||||
columns: processedColumns,
|
||||
filters,
|
||||
filters: initialValues,
|
||||
includeSearch,
|
||||
metrics,
|
||||
onAddFilter,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="treemap"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,9 +33,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,13 @@
|
||||
*/
|
||||
/* eslint-disable sort-keys */
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, numberFormat, treemapRatio } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
colorScheme,
|
||||
numberFormat,
|
||||
treemapRatio,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="word-cloud"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,8 +33,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -29,13 +29,13 @@ function transformData(data, formData) {
|
||||
}
|
||||
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, rotation, sizeTo, sizeFrom } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
height,
|
||||
data: transformData(payload.data, formData),
|
||||
data: transformData(queryData.data, formData),
|
||||
colorScheme,
|
||||
rotation,
|
||||
sizeRange: [sizeFrom, sizeTo],
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="world-map"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -33,8 +33,8 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { height, formData, payload } = chartProps;
|
||||
const { height, formData, queryData } = chartProps;
|
||||
const { maxBubbleSize, showBubbles } = formData;
|
||||
|
||||
return {
|
||||
data: payload.data,
|
||||
data: queryData.data,
|
||||
height,
|
||||
maxBubbleSize: parseInt(maxBubbleSize, 10),
|
||||
showBubbles,
|
||||
|
@ -33,13 +33,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="big-number"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -34,13 +34,13 @@
|
||||
"shortid": "^2.2.14"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/core": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/dimension": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/core": "^0.12.0",
|
||||
"@superset-ui/dimension": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import { renderTooltipFactory } from './BigNumber';
|
||||
const TIME_COLUMN = '__timestamp';
|
||||
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const {
|
||||
colorPicker,
|
||||
compareLag: compareLagInput,
|
||||
@ -38,7 +38,7 @@ export default function transformProps(chartProps) {
|
||||
vizType,
|
||||
yAxisFormat,
|
||||
} = formData;
|
||||
const { data } = payload;
|
||||
const { data } = queryData;
|
||||
|
||||
let mainColor;
|
||||
if (colorPicker) {
|
||||
|
@ -33,13 +33,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="line"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -41,13 +41,13 @@
|
||||
"urijs": "^1.18.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/core": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/dimension": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/core": "^0.12.0",
|
||||
"@superset-ui/dimension": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^15 || ^16"
|
||||
}
|
||||
}
|
||||
|
@ -55,12 +55,12 @@ function getJson(url) {
|
||||
* Show multiple line charts
|
||||
*
|
||||
* This visualization works by fetching the data from each of the saved
|
||||
* charts, building the payload data and passing it along to nvd3Vis.
|
||||
* charts, building the queryData data and passing it along to nvd3Vis.
|
||||
*/
|
||||
class LineMulti extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { payload: [] };
|
||||
this.state = { queryData: [] };
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -72,8 +72,8 @@ class LineMulti extends React.Component {
|
||||
}
|
||||
|
||||
loadData(props) {
|
||||
const { formData, payload } = props;
|
||||
const { slices } = payload.data;
|
||||
const { formData, queryData } = props;
|
||||
const { slices } = queryData.data;
|
||||
const {
|
||||
extraFilters,
|
||||
filters,
|
||||
@ -83,7 +83,7 @@ class LineMulti extends React.Component {
|
||||
timeRange,
|
||||
} = formData;
|
||||
|
||||
this.setState({ payload: [] });
|
||||
this.setState({ queryData: [] });
|
||||
|
||||
// fetch data from all the charts
|
||||
const subslices = [
|
||||
@ -112,26 +112,26 @@ class LineMulti extends React.Component {
|
||||
});
|
||||
|
||||
Promise.all(promises).then(data => {
|
||||
const payloadCopy = { ...payload };
|
||||
payloadCopy.data = [].concat(...data);
|
||||
const queryDataCopy = { ...queryData };
|
||||
queryDataCopy.data = [].concat(...data);
|
||||
|
||||
// add null values at the edges to fix multiChart bug when series with
|
||||
// different x values use different y axes
|
||||
if (lineCharts.length && lineCharts2.length) {
|
||||
let minX = Infinity;
|
||||
let maxX = -Infinity;
|
||||
payloadCopy.data.forEach(datum => {
|
||||
queryDataCopy.data.forEach(datum => {
|
||||
minX = Math.min(minX, ...datum.values.map(v => v.x));
|
||||
maxX = Math.max(maxX, ...datum.values.map(v => v.x));
|
||||
});
|
||||
// add null values at the edges
|
||||
payloadCopy.data.forEach(datum => {
|
||||
queryDataCopy.data.forEach(datum => {
|
||||
datum.values.push({ x: minX, y: null });
|
||||
datum.values.push({ x: maxX, y: null });
|
||||
});
|
||||
}
|
||||
|
||||
this.setState({ payload: payloadCopy });
|
||||
this.setState({ queryData: queryDataCopy });
|
||||
});
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ class LineMulti extends React.Component {
|
||||
onAddFilter,
|
||||
onError,
|
||||
} = this.props;
|
||||
const { payload } = this.state;
|
||||
const { queryData } = this.state;
|
||||
|
||||
return (
|
||||
<ReactNVD3
|
||||
@ -157,7 +157,7 @@ class LineMulti extends React.Component {
|
||||
formData,
|
||||
onError,
|
||||
onAddFilter,
|
||||
payload,
|
||||
queryData,
|
||||
})}
|
||||
/>
|
||||
);
|
||||
|
@ -20,17 +20,12 @@
|
||||
import isTruthy from './utils/isTruthy';
|
||||
import { formatLabel } from './utils';
|
||||
|
||||
const NOOP = () => {};
|
||||
|
||||
export default function transformProps(chartProps) {
|
||||
const {
|
||||
width,
|
||||
height,
|
||||
annotationData,
|
||||
datasource,
|
||||
formData,
|
||||
onError,
|
||||
onAddFilter,
|
||||
payload,
|
||||
} = chartProps;
|
||||
const { width, height, annotationData, datasource, formData, hooks, queryData } = chartProps;
|
||||
|
||||
const { onAddFilter = NOOP, onError = NOOP } = hooks;
|
||||
|
||||
const {
|
||||
annotationLayers,
|
||||
@ -76,7 +71,7 @@ export default function transformProps(chartProps) {
|
||||
yLogScale,
|
||||
} = formData;
|
||||
|
||||
const rawData = payload.data || [];
|
||||
const rawData = queryData.data || [];
|
||||
const data = Array.isArray(rawData)
|
||||
? rawData.map(row => ({
|
||||
...row,
|
||||
|
@ -23,13 +23,11 @@ Then use it via `SuperChart`. A link to Storybook for the Icicle Event Chart wil
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="icicle"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
||||
|
@ -41,10 +41,10 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.11.6",
|
||||
"@superset-ui/color": "^0.11.0",
|
||||
"@superset-ui/core": "^0.11.0",
|
||||
"@superset-ui/translation": "^0.11.0",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/core": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^16.2"
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ import { ChartProps } from '@superset-ui/chart';
|
||||
import { findDepth } from './utils/IcicleEventTreeHelpers';
|
||||
|
||||
export default function transformProps(chartProps: ChartProps) {
|
||||
const { formData, payload, width } = chartProps;
|
||||
const { formData, queryData, width } = chartProps;
|
||||
// Need to double check if actually part of formData
|
||||
const { color, isVertical, rounding, transitionDuration } = formData;
|
||||
const { data } = payload;
|
||||
const { data } = queryData;
|
||||
|
||||
const chartPropsHeight = chartProps.height;
|
||||
const rectHeight = 30;
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="table"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -30,10 +30,11 @@
|
||||
"@airbnb/lunar-icons": "^2.1.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.11.14",
|
||||
"@superset-ui/number-format": "^0.11.14",
|
||||
"@superset-ui/time-format": "^0.11.14",
|
||||
"@superset-ui/translation": "^0.11.9",
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/number-format": "^0.12.0",
|
||||
"@superset-ui/query": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0",
|
||||
"react": "^16.8.6"
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ type Props = {
|
||||
tableFilter: boolean;
|
||||
};
|
||||
|
||||
function NOOP(_key: string, _value: number[]) {}
|
||||
const NOOP = () => {};
|
||||
|
||||
const defaultProps = {
|
||||
alignPositiveNegative: false,
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { ChartFormData, ChartFormDataMetric } from '@superset-ui/chart';
|
||||
import { QueryFormData, QueryFormDataMetric } from '@superset-ui/query';
|
||||
|
||||
type TableFormData = ChartFormData & {
|
||||
type TableFormData = QueryFormData & {
|
||||
all_columns: string[];
|
||||
percent_metrics: ChartFormDataMetric[];
|
||||
percent_metrics: QueryFormDataMetric[];
|
||||
include_time: boolean;
|
||||
order_by_cols: string[];
|
||||
};
|
||||
|
@ -1,5 +1,9 @@
|
||||
import { buildQueryContext, ChartFormDataMetric, QueryObjectMetric } from '@superset-ui/chart';
|
||||
import convertMetric from '@superset-ui/chart/lib/query/convertMetric';
|
||||
import {
|
||||
buildQueryContext,
|
||||
convertMetric,
|
||||
QueryFormDataMetric,
|
||||
QueryObjectMetric,
|
||||
} from '@superset-ui/query';
|
||||
import TableFormData from './TableFormData';
|
||||
|
||||
export default function buildQuery(formData: TableFormData) {
|
||||
@ -14,7 +18,7 @@ export default function buildQuery(formData: TableFormData) {
|
||||
columns = [...formData.all_columns];
|
||||
const orderByColumns = formData.order_by_cols || [];
|
||||
orderByColumns.forEach(columnOrder => {
|
||||
const parsedColumnOrder: [ChartFormDataMetric, boolean] = JSON.parse(columnOrder);
|
||||
const parsedColumnOrder: [QueryFormDataMetric, boolean] = JSON.parse(columnOrder);
|
||||
orderby.push([convertMetric(parsedColumnOrder[0]), parsedColumnOrder[1]]);
|
||||
});
|
||||
groupby = [];
|
||||
|
@ -23,8 +23,13 @@ import processColumns from '../processColumns';
|
||||
import processMetrics from '../processMetrics';
|
||||
import processData from '../processData';
|
||||
|
||||
const NOOP = () => {};
|
||||
|
||||
export default function transformProps(chartProps: ChartProps) {
|
||||
const { height, datasource, filters, formData, onAddFilter, payload } = chartProps;
|
||||
const { height, datasource, initialValues, formData, hooks, queryData } = chartProps;
|
||||
|
||||
const { onAddFilter = NOOP } = hooks;
|
||||
|
||||
const {
|
||||
alignPn,
|
||||
colorPn,
|
||||
@ -37,7 +42,7 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
tableTimestampFormat,
|
||||
timeseriesLimitMetric,
|
||||
} = formData;
|
||||
const { records, columns } = payload.data;
|
||||
const { records, columns } = queryData.data;
|
||||
|
||||
const metrics = processMetrics({
|
||||
metrics: rawMetrics,
|
||||
@ -66,7 +71,7 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
alignPositiveNegative: alignPn,
|
||||
colorPositiveNegative: colorPn,
|
||||
columns: processedColumns,
|
||||
filters,
|
||||
filters: initialValues,
|
||||
includeSearch,
|
||||
onAddFilter,
|
||||
orderDesc,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ChartFormDataMetric, AdhocMetric } from '@superset-ui/chart';
|
||||
import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query';
|
||||
import { PlainObject } from './types';
|
||||
|
||||
export default function processData({
|
||||
@ -7,7 +7,7 @@ export default function processData({
|
||||
records,
|
||||
metrics,
|
||||
}: {
|
||||
timeseriesLimitMetric: ChartFormDataMetric;
|
||||
timeseriesLimitMetric: QueryFormDataMetric;
|
||||
orderDesc: boolean;
|
||||
records: PlainObject[];
|
||||
metrics: string[];
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ChartFormDataMetric, AdhocMetric } from '@superset-ui/chart';
|
||||
import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query';
|
||||
import { PlainObject } from './types';
|
||||
|
||||
export default function processMetrics({
|
||||
@ -6,8 +6,8 @@ export default function processMetrics({
|
||||
percentMetrics,
|
||||
records,
|
||||
}: {
|
||||
metrics: ChartFormDataMetric[];
|
||||
percentMetrics: ChartFormDataMetric[];
|
||||
metrics: QueryFormDataMetric[];
|
||||
percentMetrics: QueryFormDataMetric[];
|
||||
records: PlainObject[];
|
||||
}) {
|
||||
const processedMetrics = (metrics || []).map(m => (m as AdhocMetric).label || (m as string));
|
||||
|
@ -17,7 +17,8 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { ChartProps, ChartFormDataMetric, AdhocMetric } from '@superset-ui/chart';
|
||||
import { ChartProps } from '@superset-ui/chart';
|
||||
import { QueryFormDataMetric, AdhocMetric } from '@superset-ui/query';
|
||||
import processColumns from './processColumns';
|
||||
import processMetrics from './processMetrics';
|
||||
import processData from './processData';
|
||||
@ -44,7 +45,7 @@ function transformData(data: PlainObject[], formData: PlainObject) {
|
||||
|
||||
// handle percentage columns.
|
||||
const percentMetrics: string[] = (formData.percentMetrics || []).map(
|
||||
(metric: ChartFormDataMetric) => (metric as AdhocMetric).label || (metric as string),
|
||||
(metric: QueryFormDataMetric) => (metric as AdhocMetric).label || (metric as string),
|
||||
);
|
||||
|
||||
if (percentMetrics.length > 0) {
|
||||
@ -82,8 +83,13 @@ function transformData(data: PlainObject[], formData: PlainObject) {
|
||||
};
|
||||
}
|
||||
|
||||
const NOOP = () => {};
|
||||
|
||||
export default function transformProps(chartProps: ChartProps) {
|
||||
const { height, datasource, filters, formData, onAddFilter, payload } = chartProps;
|
||||
const { height, datasource, initialValues, formData, hooks, queryData } = chartProps;
|
||||
|
||||
const { onAddFilter = NOOP } = hooks;
|
||||
|
||||
const {
|
||||
alignPn,
|
||||
colorPn,
|
||||
@ -96,7 +102,7 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
tableTimestampFormat,
|
||||
timeseriesLimitMetric,
|
||||
} = formData;
|
||||
const { records, columns } = transformData(payload.data, formData);
|
||||
const { records, columns } = transformData(queryData.data, formData);
|
||||
|
||||
const metrics = processMetrics({
|
||||
metrics: rawMetrics,
|
||||
@ -124,7 +130,7 @@ export default function transformProps(chartProps: ChartProps) {
|
||||
colorPositiveNegative: colorPn,
|
||||
columns: processedColumns,
|
||||
data: processedData,
|
||||
filters,
|
||||
filters: initialValues,
|
||||
height,
|
||||
includeSearch,
|
||||
onAddFilter,
|
||||
|
@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
|
||||
```js
|
||||
<SuperChart
|
||||
chartType="word-cloud"
|
||||
chartProps={{
|
||||
width: 600,
|
||||
height: 600,
|
||||
formData: {...},
|
||||
payload: {
|
||||
data: {...},
|
||||
},
|
||||
width={600}
|
||||
height={600}
|
||||
formData={...}
|
||||
queryData={{
|
||||
data: {...},
|
||||
}}
|
||||
/>
|
||||
```
|
@ -39,8 +39,9 @@
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/color": "^0.10.0 || ^0.11.0",
|
||||
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/query": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { ChartFormData } from '@superset-ui/chart';
|
||||
import { QueryFormData } from '@superset-ui/query';
|
||||
|
||||
// FormData for wordcloud contains both common properties of all form data
|
||||
// and properties specific to wordcloud vizzes
|
||||
type WordCloudFormData = ChartFormData & {
|
||||
type WordCloudFormData = QueryFormData & {
|
||||
series: string;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { buildQueryContext } from '@superset-ui/chart';
|
||||
import { buildQueryContext } from '@superset-ui/query';
|
||||
import WordCloudFormData from './WordCloudFormData';
|
||||
|
||||
export default function buildQuery(formData: WordCloudFormData) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ChartProps } from '@superset-ui/chart';
|
||||
|
||||
function transformData(data: ChartProps['payload'][], formData: ChartProps['formData']) {
|
||||
function transformData(data: ChartProps['queryData'][], formData: ChartProps['formData']) {
|
||||
const { metric, series } = formData;
|
||||
|
||||
const transformedData = data.map(datum => ({
|
||||
@ -12,12 +12,12 @@ function transformData(data: ChartProps['payload'][], formData: ChartProps['form
|
||||
}
|
||||
|
||||
export default function transformProps(chartProps: ChartProps) {
|
||||
const { width, height, formData, payload } = chartProps;
|
||||
const { width, height, formData, queryData } = chartProps;
|
||||
const { colorScheme, rotation, sizeTo, sizeFrom } = formData;
|
||||
|
||||
return {
|
||||
colorScheme,
|
||||
data: transformData(payload.data, formData),
|
||||
data: transformData(queryData.data, formData),
|
||||
height,
|
||||
rotation,
|
||||
sizeRange: [sizeFrom, sizeTo],
|
||||
|
@ -17,7 +17,7 @@ describe('WordCloud tranformProps', () => {
|
||||
formData,
|
||||
width: 800,
|
||||
height: 600,
|
||||
payload: {
|
||||
queryData: {
|
||||
data: [{ name: 'Hulk', sum__num: 1 }],
|
||||
},
|
||||
});
|
||||
|
@ -50,11 +50,11 @@
|
||||
"terser-webpack-plugin": "1.4.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@superset-ui/chart": "^0.11.13",
|
||||
"@superset-ui/chart-composition": "^0.11.9",
|
||||
"@superset-ui/color": "^0.11.9",
|
||||
"@superset-ui/connection": "^0.11.0",
|
||||
"@superset-ui/time-format": "^0.11.0",
|
||||
"@superset-ui/translation": "^0.11.4"
|
||||
"@superset-ui/chart": "^0.12.0",
|
||||
"@superset-ui/chart-composition": "^0.12.0",
|
||||
"@superset-ui/color": "^0.12.0",
|
||||
"@superset-ui/connection": "^0.12.0",
|
||||
"@superset-ui/time-format": "^0.12.0",
|
||||
"@superset-ui/translation": "^0.12.0"
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export default function createQueryStory({
|
||||
formData={payload.formData}
|
||||
// @TODO fix typing
|
||||
// all vis's now expect objects but api/v1/ returns an array
|
||||
payload={
|
||||
queryData={
|
||||
Array.isArray(payload.queryData)
|
||||
? payload.queryData[0]
|
||||
: payload.queryData
|
||||
|
@ -12,7 +12,7 @@ export default [
|
||||
width={400}
|
||||
height={400}
|
||||
datasource={dummyDatasource}
|
||||
payload={{ data }}
|
||||
queryData={{ data }}
|
||||
formData={{
|
||||
cellSize: 10,
|
||||
cellPadding: 2,
|
||||
|
@ -10,7 +10,7 @@ export default [
|
||||
chartType="chord"
|
||||
width={400}
|
||||
height={400}
|
||||
payload={{ data }}
|
||||
queryData={{ data }}
|
||||
formData={{
|
||||
colorScheme: 'd3Category10',
|
||||
yAxisFormat: '.2f',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user