-
Notifications
You must be signed in to change notification settings - Fork 77
feat: improve line chart margin/axis and add buildquery #66
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.
Woo thanks!
const defaultProps = { | ||
className: '', | ||
margin: { top: 20, right: 20, left: 20, bottom: 20 }, | ||
margin: DEFAULT_MARGIN, |
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.
I don't think you need this since you're doing margin: { ...DEFAULT_MARGIN, ...margin },
down below anyway
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.
It is useful for deriving the type as well. (typeof defaultProps
)
packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts
Outdated
Show resolved
Hide resolved
packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx
Outdated
Show resolved
Hide resolved
@@ -4,13 +4,14 @@ import { ChartProps } from '@superset-ui/chart'; | |||
|
|||
export default function transformProps(chartProps: ChartProps) { | |||
const { width, height, formData, payload } = chartProps; | |||
const { encoding } = formData; | |||
const { encoding, margin } = formData; | |||
const { data } = payload; | |||
|
|||
return { | |||
data, |
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.
Here, we need to implement get_data
logic here. https://github.com/apache/incubator-superset/blob/master/superset/viz.py#L1222
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.
If I don't implement anything, will it behave just like the word cloud query? I plan to get this pr in as a starter and will develop the buildQuery in a separate pr.
packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts
Outdated
Show resolved
Hide resolved
packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx
Outdated
Show resolved
Hide resolved
Deploy preview for superset-ui-plugins ready! Built with commit 799b3dd |
Deploy preview for superset-ui-plugins ready! Built with commit 01481c1 |
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! Thanks for adding this :)
…set#66) * fix: fallback to default margin when margin is partially set * feat: can disable axis title * feat: adjust margin according to axis title visibility * feat: include margin in formData * feat: add buildQuery * fix: address kyle comments * fix: remove string false
🏆 Enhancements
📜 Documentation
🐛 Bug Fix
🏠 Internal