superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Rename onTooltip to setTooltip (#6103)
Date Mon, 15 Oct 2018 16:27:05 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new dc7b6f2  Rename onTooltip to setTooltip (#6103)
dc7b6f2 is described below

commit dc7b6f2baea5ecd1aedea81a416b9781935b977e
Author: Krist Wongsuphasawat <krist.wongz@gmail.com>
AuthorDate: Mon Oct 15 09:26:59 2018 -0700

    Rename onTooltip to setTooltip (#6103)
    
    * rename onTooltip to setTooltip
    
    * fix typo
---
 .../src/visualizations/deckgl/CategoricalDeckGLContainer.jsx |  6 +++---
 superset/assets/src/visualizations/deckgl/createAdaptor.jsx  |  2 +-
 superset/assets/src/visualizations/deckgl/factory.jsx        | 12 ++++++------
 superset/assets/src/visualizations/deckgl/layers/Arc/Arc.jsx |  4 ++--
 .../src/visualizations/deckgl/layers/Geojson/Geojson.jsx     | 12 ++++++------
 .../assets/src/visualizations/deckgl/layers/Grid/Grid.jsx    |  4 ++--
 superset/assets/src/visualizations/deckgl/layers/Hex/Hex.jsx |  4 ++--
 .../assets/src/visualizations/deckgl/layers/Path/Path.jsx    |  4 ++--
 .../src/visualizations/deckgl/layers/Polygon/Polygon.jsx     |  4 ++--
 .../visualizations/deckgl/layers/Screengrid/Screengrid.jsx   | 10 +++++-----
 superset/assets/src/visualizations/deckgl/layers/common.jsx  |  6 +++---
 11 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx b/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
index 61c9eed..ef4c4e2 100644
--- a/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
+++ b/superset/assets/src/visualizations/deckgl/CategoricalDeckGLContainer.jsx
@@ -38,7 +38,7 @@ const propTypes = {
   getLayer: PropTypes.func.isRequired,
   payload: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
-  onTooltip: PropTypes.func,
+  setTooltip: PropTypes.func,
 };
 
 export default class CategoricalDeckGLContainer extends React.PureComponent {
@@ -77,7 +77,7 @@ export default class CategoricalDeckGLContainer extends React.PureComponent
{
       payload,
       formData: fd,
       onAddFilter,
-      onTooltip,
+      setTooltip,
     } = this.props;
     let data = [...payload.data.features];
 
@@ -103,7 +103,7 @@ export default class CategoricalDeckGLContainer extends React.PureComponent
{
     }
 
     payload.data.features = data;
-    return [getLayer(fd, payload, onAddFilter, onTooltip)];
+    return [getLayer(fd, payload, onAddFilter, setTooltip)];
   }
   addColor(data, fd) {
     const c = fd.color_picker || { r: 0, g: 0, b: 0, a: 1 };
diff --git a/superset/assets/src/visualizations/deckgl/createAdaptor.jsx b/superset/assets/src/visualizations/deckgl/createAdaptor.jsx
index 6dfe11b..080bf68 100644
--- a/superset/assets/src/visualizations/deckgl/createAdaptor.jsx
+++ b/superset/assets/src/visualizations/deckgl/createAdaptor.jsx
@@ -15,7 +15,7 @@ class DeckGlChartInput {
     };
 
     this.onAddFilter = ((...args) => { slice.addFilter(...args); });
-    this.onTooltip = ((...args) => { slice.tooltip(...args); });
+    this.setTooltip = ((...args) => { slice.setTooltip(...args); });
   }
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/factory.jsx b/superset/assets/src/visualizations/deckgl/factory.jsx
index fc61e34..73d48af 100644
--- a/superset/assets/src/visualizations/deckgl/factory.jsx
+++ b/superset/assets/src/visualizations/deckgl/factory.jsx
@@ -10,11 +10,11 @@ const propTypes = {
   setControlValue: PropTypes.func.isRequired,
   viewport: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
-  onTooltip: PropTypes.func,
+  setTooltip: PropTypes.func,
 };
 const defaultProps = {
   onAddFilter() {},
-  onTooltip() {},
+  setTooltip() {},
 };
 
 export function createDeckGLComponent(getLayer, getPoints) {
@@ -24,7 +24,7 @@ export function createDeckGLComponent(getLayer, getPoints) {
       payload,
       setControlValue,
       onAddFilter,
-      onTooltip,
+      setTooltip,
       viewport: originalViewport,
     } = props;
 
@@ -32,7 +32,7 @@ export function createDeckGLComponent(getLayer, getPoints) {
       ? fitViewport(originalViewport, getPoints(payload.data.features))
       : originalViewport;
 
-    const layer = getLayer(formData, payload, onAddFilter, onTooltip);
+    const layer = getLayer(formData, payload, onAddFilter, setTooltip);
 
     return (
       <DeckGLContainer
@@ -58,7 +58,7 @@ export function createCategoricalDeckGLComponent(getLayer, getPoints) {
       payload,
       setControlValue,
       onAddFilter,
-      onTooltip,
+      setTooltip,
       viewport: originalViewport,
     } = props;
 
@@ -75,7 +75,7 @@ export function createCategoricalDeckGLComponent(getLayer, getPoints) {
         getLayer={getLayer}
         payload={payload}
         onAddFilter={onAddFilter}
-        onTooltip={onTooltip}
+        setTooltip={setTooltip}
       />
     );
   }
diff --git a/superset/assets/src/visualizations/deckgl/layers/Arc/Arc.jsx b/superset/assets/src/visualizations/deckgl/layers/Arc/Arc.jsx
index bfd193b..d74c21d 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Arc/Arc.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Arc/Arc.jsx
@@ -12,7 +12,7 @@ function getPoints(data) {
   return points;
 }
 
-export function getLayer(fd, payload, onAddFilter, onTooltip) {
+export function getLayer(fd, payload, onAddFilter, setTooltip) {
   const data = payload.data.features;
   const sc = fd.color_picker;
   const tc = fd.target_color_picker;
@@ -22,7 +22,7 @@ export function getLayer(fd, payload, onAddFilter, onTooltip) {
     getSourceColor: d => d.sourceColor || d.color || [sc.r, sc.g, sc.b, 255 * sc.a],
     getTargetColor: d => d.targetColor || d.color || [tc.r, tc.g, tc.b, 255 * tc.a],
     strokeWidth: (fd.stroke_width) ? fd.stroke_width : 3,
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx b/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
index a8cb35f..f9f0b6e 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
@@ -58,7 +58,7 @@ const recurseGeoJson = (node, propOverrides, extraProps) => {
   }
 };
 
-export function getLayer(formData, payload, onAddFilter, onTooltip) {
+export function getLayer(formData, payload, onAddFilter, setTooltip) {
   const fd = formData;
   const fc = fd.fill_color_picker;
   const sc = fd.stroke_color_picker;
@@ -89,7 +89,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip) {
     stroked: fd.stroked,
     extruded: fd.extruded,
     pointRadiusScale: fd.point_radius_scale,
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
@@ -99,11 +99,11 @@ const propTypes = {
   setControlValue: PropTypes.func.isRequired,
   viewport: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
-  onTooltip: PropTypes.func,
+  setTooltip: PropTypes.func,
 };
 const defaultProps = {
   onAddFilter() {},
-  onTooltip() {},
+  setTooltip() {},
 };
 
 function deckGeoJson(props) {
@@ -112,7 +112,7 @@ function deckGeoJson(props) {
     payload,
     setControlValue,
     onAddFilter,
-    onTooltip,
+    setTooltip,
     viewport,
   } = props;
 
@@ -121,7 +121,7 @@ function deckGeoJson(props) {
   //   viewport = common.fitViewport(viewport, geojsonExtent(payload.data.features));
   // }
 
-  const layer = getLayer(formData, payload, onAddFilter, onTooltip);
+  const layer = getLayer(formData, payload, onAddFilter, setTooltip);
 
   return (
     <DeckGLContainer
diff --git a/superset/assets/src/visualizations/deckgl/layers/Grid/Grid.jsx b/superset/assets/src/visualizations/deckgl/layers/Grid/Grid.jsx
index 0c00667..63dd12c 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Grid/Grid.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Grid/Grid.jsx
@@ -4,7 +4,7 @@ import sandboxedEval from '../../../../modules/sandbox';
 import createAdaptor from '../../createAdaptor';
 import { createDeckGLComponent } from '../../factory';
 
-export function getLayer(formData, payload, onAddFilter, onTooltip) {
+export function getLayer(formData, payload, onAddFilter, setTooltip) {
   const fd = formData;
   const c = fd.color_picker;
   let data = payload.data.features.map(d => ({
@@ -29,7 +29,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip) {
     outline: false,
     getElevationValue: points => points.reduce((sum, point) => sum + point.weight,
0),
     getColorValue: points => points.reduce((sum, point) => sum + point.weight, 0),
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/layers/Hex/Hex.jsx b/superset/assets/src/visualizations/deckgl/layers/Hex/Hex.jsx
index 8788517..6919819 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Hex/Hex.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Hex/Hex.jsx
@@ -4,7 +4,7 @@ import sandboxedEval from '../../../../modules/sandbox';
 import createAdaptor from '../../createAdaptor';
 import { createDeckGLComponent } from '../../factory';
 
-export function getLayer(formData, payload, onAddFilter, onTooltip) {
+export function getLayer(formData, payload, onAddFilter, setTooltip) {
   const fd = formData;
   const c = fd.color_picker;
   let data = payload.data.features.map(d => ({
@@ -29,7 +29,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip) {
     outline: false,
     getElevationValue: points => points.reduce((sum, point) => sum + point.weight,
0),
     getColorValue: points => points.reduce((sum, point) => sum + point.weight, 0),
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/layers/Path/Path.jsx b/superset/assets/src/visualizations/deckgl/layers/Path/Path.jsx
index 0dc279b..052868d 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Path/Path.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Path/Path.jsx
@@ -4,7 +4,7 @@ import sandboxedEval from '../../../../modules/sandbox';
 import createAdaptor from '../../createAdaptor';
 import { createDeckGLComponent } from '../../factory';
 
-export function getLayer(formData, payload, onAddFilter, onTooltip) {
+export function getLayer(formData, payload, onAddFilter, setTooltip) {
   const fd = formData;
   const c = fd.color_picker;
   const fixedColor = [c.r, c.g, c.b, 255 * c.a];
@@ -25,7 +25,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip) {
     data,
     rounded: true,
     widthScale: 1,
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx b/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx
index a6b1681..82164c6 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Polygon/Polygon.jsx
@@ -11,7 +11,7 @@ function getPoints(features) {
   return flatten(features.map(d => d.polygon), true);
 }
 
-export function getLayer(formData, payload, onAddFilter, onTooltip) {
+export function getLayer(formData, payload, onAddFilter, setTooltip) {
   const fd = formData;
   const fc = fd.fill_color_picker;
   const sc = fd.stroke_color_picker;
@@ -45,7 +45,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip) {
     getLineWidth: fd.line_width,
     extruded: fd.extruded,
     fp64: true,
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
diff --git a/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx b/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
index 776cf81..1018f1f 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
@@ -13,7 +13,7 @@ function getPoints(data) {
   return data.map(d => d.position);
 }
 
-export function getLayer(formData, payload, onAddFilter, onTooltip, filters) {
+export function getLayer(formData, payload, onAddFilter, setTooltip, filters) {
   const fd = formData;
   const c = fd.color_picker;
   let data = payload.data.features.map(d => ({
@@ -44,7 +44,7 @@ export function getLayer(formData, payload, onAddFilter, onTooltip, filters)
{
     maxColor: [c.r, c.g, c.b, 255 * c.a],
     outline: false,
     getWeight: d => d.weight || 0,
-    ...commonLayerProps(fd, onAddFilter, onTooltip),
+    ...commonLayerProps(fd, onAddFilter, setTooltip),
   });
 }
 
@@ -54,11 +54,11 @@ const propTypes = {
   setControlValue: PropTypes.func.isRequired,
   viewport: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
-  onTooltip: PropTypes.func,
+  setTooltip: PropTypes.func,
 };
 const defaultProps = {
   onAddFilter() {},
-  onTooltip() {},
+  setTooltip() {},
 };
 
 class DeckGLScreenGrid extends React.PureComponent {
@@ -95,7 +95,7 @@ class DeckGLScreenGrid extends React.PureComponent {
       this.props.formData,
       this.props.payload,
       this.props.onAddFilter,
-      this.props.onTooltip,
+      this.props.setTooltip,
       filters);
 
     return [layer];
diff --git a/superset/assets/src/visualizations/deckgl/layers/common.jsx b/superset/assets/src/visualizations/deckgl/layers/common.jsx
index a0b1e13..5a035cb 100644
--- a/superset/assets/src/visualizations/deckgl/layers/common.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/common.jsx
@@ -31,7 +31,7 @@ export function fitViewport(viewport, points, padding = 10) {
   }
 }
 
-export function commonLayerProps(formData, onAddFilter, onTooltip) {
+export function commonLayerProps(formData, onAddFilter, setTooltip) {
   const fd = formData;
   let onHover;
   let tooltipContentGenerator;
@@ -48,13 +48,13 @@ export function commonLayerProps(formData, onAddFilter, onTooltip) {
   if (tooltipContentGenerator) {
     onHover = (o) => {
       if (o.picked) {
-        onTooltip({
+        setTooltip({
           content: tooltipContentGenerator(o),
           x: o.x,
           y: o.y,
         });
       } else {
-        onTooltip(null);
+        setTooltip(null);
       }
     };
   }


Mime
View raw message