diff --git a/doc/gui/extension/example_library/front-end/src/Dashboard.tsx b/doc/gui/extension/example_library/front-end/src/Dashboard.tsx index b0b1258a8..4128325e8 100644 --- a/doc/gui/extension/example_library/front-end/src/Dashboard.tsx +++ b/doc/gui/extension/example_library/front-end/src/Dashboard.tsx @@ -12,41 +12,37 @@ */ import React, { useMemo } from "react"; -import { useDynamicJsonProperty, } from "taipy-gui"; +import { useDynamicJsonProperty } from "taipy-gui"; import Plot from "react-plotly.js"; import { Data, Layout } from "plotly.js"; interface DashboardProps { - data?: string; - defaultData?: string; - layout?: string; - defaultLayout?: string; + data?: string; + defaultData?: string; + layout?: string; + defaultLayout?: string; } const Dashboard = (props: DashboardProps) => { - const value = useDynamicJsonProperty(props.data, props.defaultData || "", {} as Partial); - const dashboardLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", {} as Partial); - - const data = useMemo(() => { - if (Array.isArray(value)) { - return value as Data[]; - } - return [] as Data[]; - }, [value]); - - const baseLayout = useMemo(() => { - const layout = { - ...dashboardLayout, - }; - return layout as Partial; - }, [dashboardLayout]); - - return ( -
- -
- ); + const value = useDynamicJsonProperty(props.data, props.defaultData || "", {} as Partial); + const dashboardLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", {} as Partial); + + const data = useMemo(() => { + if (Array.isArray(value)) { + return value as Data[]; + } + return [] as Data[]; + }, [value]); + + const baseLayout = useMemo(() => { + const layout = { + ...dashboardLayout, + }; + return layout as Partial; + }, [dashboardLayout]); + + return ; }; export default Dashboard;