-
Notifications
You must be signed in to change notification settings - Fork 19
feat: support polygon tooltip independently from superset app #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, couple small questions you're prob already on top of
{children} | ||
</div> | ||
<> | ||
<Tooltip tooltip={tooltip} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be rendered on top of the div below? (not sure what z-index is like etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Will try moving it down.
@@ -24,6 +24,8 @@ import React from 'react'; | |||
import PropTypes from 'prop-types'; | |||
import { StaticMap } from 'react-map-gl'; | |||
import DeckGL from 'deck.gl'; | |||
// eslint-disable-next-line import/extensions | |||
import Tooltip from './components/Tooltip'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to not just add .tsx
? (def a style thing 🤷♂ )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause file not found issue after transpile because the code will remain
import Tooltip from './components/Tooltip.tsx';
but Tooltip.tsx
also became Tooltip.js
through transpilation already.
@@ -88,31 +91,38 @@ export default class DeckGLContainer extends React.Component { | |||
return this.props.layers; | |||
} | |||
|
|||
setTooltip = tooltip => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do other components call these setTooltip
fn()
s? can't find references in the file so wanted to verify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, AnimatedDeckGLContainer
and CategoricalDeckGLContainer
contain DeckGLContainer
and call it via ref
.
🏆 Enhancements
The deck gl charts used to rely on props
setTooltip
from superset app to display tooltip.This PR add support for the polygon chart to handle its own tooltip independently from superset app.
From storybook
Also tested in Superset