@superset-ui/chart
Description
Example usage
<ChartDataProvider />
This component is a React utility wrapper around the @superset-ui/chart
ChartClient
and will
generally require you to setup CORS
(CROSS ORIGIN RESOURCE SHARING) to accept cross-origin
requests from domains outside your Apache Superset
instance:
-
Configure
CORS
in yourApache Superset
instance.a. Enable
CORS
requests to (minimally) the resources defined below.b. Enable
CORS
requests from the relevant domains (i.e., the app in which you will embed charts)# config.pyENABLE_CORS = TrueCORS_OPTIONS = -
Configure
SupersetClient
in the app where you will embed your charts. You can test this configuration in the@superset-ui
storybook.;SupersetClient; -
Register any desired / needed
@superset-ui
chart + color plugins.;; -
Pass
SupersetClient
to theChartDataProvider
along with the formData for the desired visualization type.
; const render = <DataProvider client=client formData=formData> <> loading && <Loader /> error && <RenderError error=error /> payload && <SuperChart type=CHART_TYPE chartProps= formData payload width height /> </> </DataProvider>;
<SuperChart />
Coming soon.
Development
@data-ui/build-config
is used to manage the build configuration for this package including babel
builds, jest testing, eslint, and prettier.