@xyo-network/react-price-forecast-plugin 2.61.0-rc.2 → 2.61.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Plugin.d.mts.map +1 -0
- package/dist/browser/Plugin.d.ts.map +1 -0
- package/dist/browser/Plugin.js +17 -0
- package/dist/browser/Plugin.js.map +1 -0
- package/dist/browser/components/DetailsBox.d.mts.map +1 -0
- package/dist/browser/components/DetailsBox.d.ts.map +1 -0
- package/dist/browser/components/DetailsBox.js +42 -0
- package/dist/browser/components/DetailsBox.js.map +1 -0
- package/dist/browser/components/DetailsBox.stories.js +64 -0
- package/dist/browser/components/DetailsBox.stories.js.map +1 -0
- package/dist/browser/components/index.d.mts.map +1 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +2 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/browser/index.d.mts.map +1 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/lib/DataLineStyles.d.mts.map +1 -0
- package/dist/browser/lib/DataLineStyles.d.ts.map +1 -0
- package/dist/browser/lib/DataLineStyles.js +9 -0
- package/dist/browser/lib/DataLineStyles.js.map +1 -0
- package/dist/browser/lib/DataPointStyles.d.mts.map +1 -0
- package/dist/browser/lib/DataPointStyles.d.ts.map +1 -0
- package/dist/browser/lib/DataPointStyles.js +11 -0
- package/dist/browser/lib/DataPointStyles.js.map +1 -0
- package/dist/browser/lib/ForecastLineChartConfigBuilder.d.mts.map +1 -0
- package/dist/browser/lib/ForecastLineChartConfigBuilder.d.ts.map +1 -0
- package/dist/browser/lib/ForecastLineChartConfigBuilder.js +129 -0
- package/dist/browser/lib/ForecastLineChartConfigBuilder.js.map +1 -0
- package/dist/browser/lib/MockSourcePayloads.d.mts.map +1 -0
- package/dist/browser/lib/MockSourcePayloads.d.ts.map +1 -0
- package/dist/browser/lib/MockSourcePayloads.js +23 -0
- package/dist/browser/lib/MockSourcePayloads.js.map +1 -0
- package/dist/browser/lib/SourcePayloads.d.mts.map +1 -0
- package/dist/browser/lib/SourcePayloads.d.ts.map +1 -0
- package/dist/browser/lib/SourcePayloads.js +41 -0
- package/dist/browser/lib/SourcePayloads.js.map +1 -0
- package/dist/browser/lib/index.d.mts.map +1 -0
- package/dist/browser/lib/index.d.ts.map +1 -0
- package/dist/browser/lib/index.js +4 -0
- package/dist/browser/lib/index.js.map +1 -0
- package/dist/node/Plugin.d.mts +3 -0
- package/dist/node/Plugin.d.mts.map +1 -0
- package/dist/node/Plugin.d.ts +3 -0
- package/dist/node/Plugin.d.ts.map +1 -0
- package/dist/node/Plugin.js +41 -0
- package/dist/node/Plugin.js.map +1 -0
- package/dist/node/Plugin.mjs +17 -0
- package/dist/node/Plugin.mjs.map +1 -0
- package/dist/node/components/DetailsBox.d.mts +9 -0
- package/dist/node/components/DetailsBox.d.mts.map +1 -0
- package/dist/node/components/DetailsBox.d.ts +9 -0
- package/dist/node/components/DetailsBox.d.ts.map +1 -0
- package/dist/node/components/DetailsBox.js +56 -0
- package/dist/node/components/DetailsBox.js.map +1 -0
- package/dist/node/components/DetailsBox.mjs +42 -0
- package/dist/node/components/DetailsBox.mjs.map +1 -0
- package/dist/node/components/DetailsBox.stories.js +89 -0
- package/dist/node/components/DetailsBox.stories.js.map +1 -0
- package/dist/node/components/DetailsBox.stories.mjs +64 -0
- package/dist/node/components/DetailsBox.stories.mjs.map +1 -0
- package/dist/node/components/index.d.mts +2 -0
- package/dist/node/components/index.d.mts.map +1 -0
- package/dist/node/components/index.d.ts +2 -0
- package/dist/node/components/index.d.ts.map +1 -0
- package/dist/node/components/index.js +23 -0
- package/dist/node/components/index.js.map +1 -0
- package/dist/node/components/index.mjs +2 -0
- package/dist/node/components/index.mjs.map +1 -0
- package/dist/node/index.d.mts +3 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +25 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +3 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/DataLineStyles.d.mts +5 -0
- package/dist/node/lib/DataLineStyles.d.mts.map +1 -0
- package/dist/node/lib/DataLineStyles.d.ts +5 -0
- package/dist/node/lib/DataLineStyles.d.ts.map +1 -0
- package/dist/node/lib/DataLineStyles.js +33 -0
- package/dist/node/lib/DataLineStyles.js.map +1 -0
- package/dist/node/lib/DataLineStyles.mjs +9 -0
- package/dist/node/lib/DataLineStyles.mjs.map +1 -0
- package/dist/node/lib/DataPointStyles.d.mts +8 -0
- package/dist/node/lib/DataPointStyles.d.mts.map +1 -0
- package/dist/node/lib/DataPointStyles.d.ts +8 -0
- package/dist/node/lib/DataPointStyles.d.ts.map +1 -0
- package/dist/node/lib/DataPointStyles.js +35 -0
- package/dist/node/lib/DataPointStyles.js.map +1 -0
- package/dist/node/lib/DataPointStyles.mjs +11 -0
- package/dist/node/lib/DataPointStyles.mjs.map +1 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.d.mts +47 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.d.mts.map +1 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.d.ts +47 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.d.ts.map +1 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.js +153 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.js.map +1 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.mjs +129 -0
- package/dist/node/lib/ForecastLineChartConfigBuilder.mjs.map +1 -0
- package/dist/node/lib/MockSourcePayloads.d.mts +18 -0
- package/dist/node/lib/MockSourcePayloads.d.mts.map +1 -0
- package/dist/node/lib/MockSourcePayloads.d.ts +18 -0
- package/dist/node/lib/MockSourcePayloads.d.ts.map +1 -0
- package/dist/node/lib/MockSourcePayloads.js +47 -0
- package/dist/node/lib/MockSourcePayloads.js.map +1 -0
- package/dist/node/lib/MockSourcePayloads.mjs +23 -0
- package/dist/node/lib/MockSourcePayloads.mjs.map +1 -0
- package/dist/node/lib/SourcePayloads.d.mts +30 -0
- package/dist/node/lib/SourcePayloads.d.mts.map +1 -0
- package/dist/node/lib/SourcePayloads.d.ts +30 -0
- package/dist/node/lib/SourcePayloads.d.ts.map +1 -0
- package/dist/node/lib/SourcePayloads.js +65 -0
- package/dist/node/lib/SourcePayloads.js.map +1 -0
- package/dist/node/lib/SourcePayloads.mjs +41 -0
- package/dist/node/lib/SourcePayloads.mjs.map +1 -0
- package/dist/node/lib/index.d.mts +4 -0
- package/dist/node/lib/index.d.mts.map +1 -0
- package/dist/node/lib/index.d.ts +4 -0
- package/dist/node/lib/index.d.ts.map +1 -0
- package/dist/node/lib/index.js +27 -0
- package/dist/node/lib/index.js.map +1 -0
- package/dist/node/lib/index.mjs +4 -0
- package/dist/node/lib/index.mjs.map +1 -0
- package/package.json +21 -21
- package/dist/Plugin.d.mts.map +0 -1
- package/dist/Plugin.d.ts.map +0 -1
- package/dist/components/DetailsBox.d.mts.map +0 -1
- package/dist/components/DetailsBox.d.ts.map +0 -1
- package/dist/components/DetailsBox.stories.d.mts +0 -6
- package/dist/components/DetailsBox.stories.d.mts.map +0 -1
- package/dist/components/DetailsBox.stories.d.ts +0 -6
- package/dist/components/DetailsBox.stories.d.ts.map +0 -1
- package/dist/components/index.d.mts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -276
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -258
- package/dist/index.mjs.map +0 -1
- package/dist/lib/DataLineStyles.d.mts.map +0 -1
- package/dist/lib/DataLineStyles.d.ts.map +0 -1
- package/dist/lib/DataPointStyles.d.mts.map +0 -1
- package/dist/lib/DataPointStyles.d.ts.map +0 -1
- package/dist/lib/ForecastLineChartConfigBuilder.d.mts.map +0 -1
- package/dist/lib/ForecastLineChartConfigBuilder.d.ts.map +0 -1
- package/dist/lib/MockSourcePayloads.d.mts.map +0 -1
- package/dist/lib/MockSourcePayloads.d.ts.map +0 -1
- package/dist/lib/SourcePayloads.d.mts.map +0 -1
- package/dist/lib/SourcePayloads.d.ts.map +0 -1
- package/dist/lib/index.d.mts.map +0 -1
- package/dist/lib/index.d.ts.map +0 -1
- /package/dist/{Plugin.d.mts → browser/Plugin.d.mts} +0 -0
- /package/dist/{Plugin.d.ts → browser/Plugin.d.ts} +0 -0
- /package/dist/{components → browser/components}/DetailsBox.d.mts +0 -0
- /package/dist/{components → browser/components}/DetailsBox.d.ts +0 -0
- /package/dist/{components → browser/components}/index.d.mts +0 -0
- /package/dist/{components → browser/components}/index.d.ts +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
- /package/dist/{lib → browser/lib}/DataLineStyles.d.mts +0 -0
- /package/dist/{lib → browser/lib}/DataLineStyles.d.ts +0 -0
- /package/dist/{lib → browser/lib}/DataPointStyles.d.mts +0 -0
- /package/dist/{lib → browser/lib}/DataPointStyles.d.ts +0 -0
- /package/dist/{lib → browser/lib}/ForecastLineChartConfigBuilder.d.mts +0 -0
- /package/dist/{lib → browser/lib}/ForecastLineChartConfigBuilder.d.ts +0 -0
- /package/dist/{lib → browser/lib}/MockSourcePayloads.d.mts +0 -0
- /package/dist/{lib → browser/lib}/MockSourcePayloads.d.ts +0 -0
- /package/dist/{lib → browser/lib}/SourcePayloads.d.mts +0 -0
- /package/dist/{lib → browser/lib}/SourcePayloads.d.ts +0 -0
- /package/dist/{lib → browser/lib}/index.d.mts +0 -0
- /package/dist/{lib → browser/lib}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailsBox.d.ts","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAA;AAI9B,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAqBpD,MAAM,WAAW,4BAA6B,SAAQ,YAAY;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAuB1E,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var DetailsBox_exports = {};
|
|
20
|
+
__export(DetailsBox_exports, {
|
|
21
|
+
PriceForecastDetailsBox: () => PriceForecastDetailsBox
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(DetailsBox_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_chartjs_adapter_luxon = require("chartjs-adapter-luxon");
|
|
26
|
+
var import_material = require("@mui/material");
|
|
27
|
+
var import_react_async_effect = require("@xylabs/react-async-effect");
|
|
28
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
+
var import_chart = require("chart.js");
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
32
|
+
var import_lib = require("../lib");
|
|
33
|
+
import_chart.Chart.register(import_chart.CategoryScale, import_chart.TimeScale, import_chart.PointElement, import_chart.LineElement, import_chart.LinearScale, import_chart.Title, import_chart.Tooltip, import_chart.Legend);
|
|
34
|
+
const PriceForecastDetailsBox = ({ payload, ...props }) => {
|
|
35
|
+
const priceForecastPayload = payload;
|
|
36
|
+
const theme = (0, import_material.useTheme)();
|
|
37
|
+
const [data, setData] = (0, import_react.useState)({ datasets: [] });
|
|
38
|
+
const [options, setOptions] = (0, import_react.useState)({});
|
|
39
|
+
(0, import_react_async_effect.useAsyncEffect)(
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
async (mounted) => {
|
|
42
|
+
const { data: data2, options: options2 } = await import_lib.ForecastLineChartConfigBuilder.create(theme, priceForecastPayload, { fetch: true });
|
|
43
|
+
if (mounted()) {
|
|
44
|
+
setData(data2);
|
|
45
|
+
setOptions(options2);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[priceForecastPayload, theme]
|
|
49
|
+
);
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { ...props, busy: priceForecastPayload === void 0, minHeight: "25vh", children: priceForecastPayload ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_chartjs_2.Line, { options, data }) : null });
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
PriceForecastDetailsBox
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=DetailsBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DetailsBox.tsx"],"sourcesContent":["import 'chartjs-adapter-luxon'\n\nimport { useTheme } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { ForecastPayload } from '@xyo-network/diviner-forecasting-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n Legend,\n LinearScale,\n LineElement,\n PointElement,\n TimeScale,\n Title,\n Tooltip,\n} from 'chart.js'\nimport { useState } from 'react'\nimport { Line } from 'react-chartjs-2'\n\nimport { ForecastLineChartConfigBuilder } from '../lib'\n\nChartJS.register(CategoryScale, TimeScale, PointElement, LineElement, LinearScale, Title, Tooltip, Legend)\n\nexport interface PriceForecastDetailsBoxProps extends FlexBoxProps {\n payload?: Payload\n}\n\nexport const PriceForecastDetailsBox: React.FC<PriceForecastDetailsBoxProps> = ({ payload, ...props }) => {\n const priceForecastPayload = payload as ForecastPayload | undefined\n const theme = useTheme()\n const [data, setData] = useState<ChartData<'line'>>({ datasets: [] })\n const [options, setOptions] = useState<ChartOptions<'line'>>({})\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n const { data, options } = await ForecastLineChartConfigBuilder.create(theme, priceForecastPayload, { fetch: true })\n if (mounted()) {\n setData(data)\n setOptions(options)\n }\n },\n [priceForecastPayload, theme],\n )\n\n return (\n <FlexCol {...props} busy={priceForecastPayload === undefined} minHeight=\"25vh\">\n {priceForecastPayload ? <Line options={options} data={data} /> : null}\n </FlexCol>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmD8B;AAnD9B,mCAAO;AAEP,sBAAyB;AACzB,gCAA+B;AAC/B,2BAAsC;AAGtC,mBAYO;AACP,mBAAyB;AACzB,6BAAqB;AAErB,iBAA+C;AAE/C,aAAAA,MAAQ,SAAS,4BAAe,wBAAW,2BAAc,0BAAa,0BAAa,oBAAO,sBAAS,mBAAM;AAMlG,MAAM,0BAAkE,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AACxG,QAAM,uBAAuB;AAC7B,QAAM,YAAQ,0BAAS;AACvB,QAAM,CAAC,MAAM,OAAO,QAAI,uBAA4B,EAAE,UAAU,CAAC,EAAE,CAAC;AACpE,QAAM,CAAC,SAAS,UAAU,QAAI,uBAA+B,CAAC,CAAC;AAE/D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,YAAM,EAAE,MAAAC,OAAM,SAAAC,SAAQ,IAAI,MAAM,0CAA+B,OAAO,OAAO,sBAAsB,EAAE,OAAO,KAAK,CAAC;AAClH,UAAI,QAAQ,GAAG;AACb,gBAAQD,KAAI;AACZ,mBAAWC,QAAO;AAAA,MACpB;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,KAAK;AAAA,EAC9B;AAEA,SACE,4CAAC,gCAAS,GAAG,OAAO,MAAM,yBAAyB,QAAW,WAAU,QACrE,iCAAuB,4CAAC,+BAAK,SAAkB,MAAY,IAAK,MACnE;AAEJ;","names":["ChartJS","data","options"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "chartjs-adapter-luxon";
|
|
3
|
+
import { useTheme } from "@mui/material";
|
|
4
|
+
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
5
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
|
6
|
+
import {
|
|
7
|
+
CategoryScale,
|
|
8
|
+
Chart as ChartJS,
|
|
9
|
+
Legend,
|
|
10
|
+
LinearScale,
|
|
11
|
+
LineElement,
|
|
12
|
+
PointElement,
|
|
13
|
+
TimeScale,
|
|
14
|
+
Title,
|
|
15
|
+
Tooltip
|
|
16
|
+
} from "chart.js";
|
|
17
|
+
import { useState } from "react";
|
|
18
|
+
import { Line } from "react-chartjs-2";
|
|
19
|
+
import { ForecastLineChartConfigBuilder } from "../lib";
|
|
20
|
+
ChartJS.register(CategoryScale, TimeScale, PointElement, LineElement, LinearScale, Title, Tooltip, Legend);
|
|
21
|
+
const PriceForecastDetailsBox = ({ payload, ...props }) => {
|
|
22
|
+
const priceForecastPayload = payload;
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const [data, setData] = useState({ datasets: [] });
|
|
25
|
+
const [options, setOptions] = useState({});
|
|
26
|
+
useAsyncEffect(
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
async (mounted) => {
|
|
29
|
+
const { data: data2, options: options2 } = await ForecastLineChartConfigBuilder.create(theme, priceForecastPayload, { fetch: true });
|
|
30
|
+
if (mounted()) {
|
|
31
|
+
setData(data2);
|
|
32
|
+
setOptions(options2);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
[priceForecastPayload, theme]
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ jsx(FlexCol, { ...props, busy: priceForecastPayload === void 0, minHeight: "25vh", children: priceForecastPayload ? /* @__PURE__ */ jsx(Line, { options, data }) : null });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
PriceForecastDetailsBox
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=DetailsBox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DetailsBox.tsx"],"sourcesContent":["import 'chartjs-adapter-luxon'\n\nimport { useTheme } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { ForecastPayload } from '@xyo-network/diviner-forecasting-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport {\n CategoryScale,\n Chart as ChartJS,\n ChartData,\n ChartOptions,\n Legend,\n LinearScale,\n LineElement,\n PointElement,\n TimeScale,\n Title,\n Tooltip,\n} from 'chart.js'\nimport { useState } from 'react'\nimport { Line } from 'react-chartjs-2'\n\nimport { ForecastLineChartConfigBuilder } from '../lib'\n\nChartJS.register(CategoryScale, TimeScale, PointElement, LineElement, LinearScale, Title, Tooltip, Legend)\n\nexport interface PriceForecastDetailsBoxProps extends FlexBoxProps {\n payload?: Payload\n}\n\nexport const PriceForecastDetailsBox: React.FC<PriceForecastDetailsBoxProps> = ({ payload, ...props }) => {\n const priceForecastPayload = payload as ForecastPayload | undefined\n const theme = useTheme()\n const [data, setData] = useState<ChartData<'line'>>({ datasets: [] })\n const [options, setOptions] = useState<ChartOptions<'line'>>({})\n\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n const { data, options } = await ForecastLineChartConfigBuilder.create(theme, priceForecastPayload, { fetch: true })\n if (mounted()) {\n setData(data)\n setOptions(options)\n }\n },\n [priceForecastPayload, theme],\n )\n\n return (\n <FlexCol {...props} busy={priceForecastPayload === undefined} minHeight=\"25vh\">\n {priceForecastPayload ? <Line options={options} data={data} /> : null}\n </FlexCol>\n )\n}\n"],"mappings":"AAmD8B;AAnD9B,OAAO;AAEP,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAuB,eAAe;AAGtC;AAAA,EACE;AAAA,EACA,SAAS;AAAA,EAGT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,SAAS,sCAAsC;AAE/C,QAAQ,SAAS,eAAe,WAAW,cAAc,aAAa,aAAa,OAAO,SAAS,MAAM;AAMlG,MAAM,0BAAkE,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AACxG,QAAM,uBAAuB;AAC7B,QAAM,QAAQ,SAAS;AACvB,QAAM,CAAC,MAAM,OAAO,IAAI,SAA4B,EAAE,UAAU,CAAC,EAAE,CAAC;AACpE,QAAM,CAAC,SAAS,UAAU,IAAI,SAA+B,CAAC,CAAC;AAE/D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,YAAM,EAAE,MAAAA,OAAM,SAAAC,SAAQ,IAAI,MAAM,+BAA+B,OAAO,OAAO,sBAAsB,EAAE,OAAO,KAAK,CAAC;AAClH,UAAI,QAAQ,GAAG;AACb,gBAAQD,KAAI;AACZ,mBAAWC,QAAO;AAAA,MACpB;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,KAAK;AAAA,EAC9B;AAEA,SACE,oBAAC,WAAS,GAAG,OAAO,MAAM,yBAAyB,QAAW,WAAU,QACrE,iCAAuB,oBAAC,QAAK,SAAkB,MAAY,IAAK,MACnE;AAEJ;","names":["data","options"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var DetailsBox_stories_exports = {};
|
|
20
|
+
__export(DetailsBox_stories_exports, {
|
|
21
|
+
Default: () => Default,
|
|
22
|
+
WithData: () => WithData,
|
|
23
|
+
default: () => DetailsBox_stories_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(DetailsBox_stories_exports);
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var import_material = require("@mui/material");
|
|
28
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
+
var import_diviner_forecasting_model = require("@xyo-network/diviner-forecasting-model");
|
|
30
|
+
var import_react2 = require("react");
|
|
31
|
+
var import_lib = require("../lib");
|
|
32
|
+
var import_DetailsBox = require("./DetailsBox");
|
|
33
|
+
const tenMin = 6e5;
|
|
34
|
+
const ForecastingDivinerPayload = {
|
|
35
|
+
schema: import_diviner_forecasting_model.ForecastPayloadSchema,
|
|
36
|
+
values: [1, 2, 3, 4, 5, 6, 7, 8].map((item) => ({
|
|
37
|
+
error: 0,
|
|
38
|
+
timestamp: Date.now() + tenMin * item,
|
|
39
|
+
value: 100 * item
|
|
40
|
+
}))
|
|
41
|
+
};
|
|
42
|
+
const StorybookEntry = {
|
|
43
|
+
argTypes: {},
|
|
44
|
+
component: import_DetailsBox.PriceForecastDetailsBox,
|
|
45
|
+
parameters: {
|
|
46
|
+
docs: {
|
|
47
|
+
page: null
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
title: "plugin/price-forecast/DetailsBox"
|
|
51
|
+
};
|
|
52
|
+
const Template = (args) => {
|
|
53
|
+
const [showPayloads, setShowPayloads] = (0, import_react2.useState)(false);
|
|
54
|
+
const forecastPayloadRef = (0, import_react2.useRef)(null);
|
|
55
|
+
const sourcePayloadsRef = (0, import_react2.useRef)(null);
|
|
56
|
+
const handleClick = (ref) => {
|
|
57
|
+
setShowPayloads(!showPayloads);
|
|
58
|
+
if (ref.current)
|
|
59
|
+
ref.current.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DetailsBox.PriceForecastDetailsBox, { mb: 3, ...args }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.ButtonGroup, { children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "contained", onClick: () => handleClick(forecastPayloadRef), children: "Forecast Payload" }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "contained", onClick: () => handleClick(sourcePayloadsRef), children: "Source Payloads" })
|
|
66
|
+
] }) }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { ref: forecastPayloadRef, children: [
|
|
68
|
+
"ForecastPayload: ",
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: JSON.stringify(args.payload, null, 2) })
|
|
70
|
+
] }) }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { ref: sourcePayloadsRef, children: [
|
|
72
|
+
"SourcePayloads: ",
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: JSON.stringify((0, import_lib.MockSourcePayloads)(), null, 2) })
|
|
74
|
+
] }) })
|
|
75
|
+
] });
|
|
76
|
+
};
|
|
77
|
+
const Default = Template.bind({});
|
|
78
|
+
Default.args = {};
|
|
79
|
+
const WithData = Template.bind({});
|
|
80
|
+
WithData.args = {
|
|
81
|
+
payload: ForecastingDivinerPayload
|
|
82
|
+
};
|
|
83
|
+
var DetailsBox_stories_default = StorybookEntry;
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
Default,
|
|
87
|
+
WithData
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=DetailsBox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DetailsBox.stories.tsx"],"sourcesContent":["import { Button, ButtonGroup, Typography } from '@mui/material'\nimport { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { ForecastPayloadSchema } from '@xyo-network/diviner-forecasting-model'\nimport { RefObject, useRef, useState } from 'react'\n\nimport { MockSourcePayloads } from '../lib'\nimport { PriceForecastDetailsBox } from './DetailsBox'\n\nconst tenMin = 600000\n\nconst ForecastingDivinerPayload = {\n schema: ForecastPayloadSchema,\n values: [1, 2, 3, 4, 5, 6, 7, 8].map((item) => ({\n error: 0,\n timestamp: Date.now() + tenMin * item,\n value: 100 * item,\n })),\n}\n\nconst StorybookEntry = {\n argTypes: {},\n component: PriceForecastDetailsBox,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'plugin/price-forecast/DetailsBox',\n} as Meta<typeof PriceForecastDetailsBox>\n\nconst Template: StoryFn<typeof PriceForecastDetailsBox> = (args) => {\n const [showPayloads, setShowPayloads] = useState(false)\n const forecastPayloadRef = useRef<HTMLParagraphElement>(null)\n const sourcePayloadsRef = useRef<HTMLParagraphElement>(null)\n const handleClick = (ref: RefObject<HTMLParagraphElement>) => {\n setShowPayloads(!showPayloads)\n if (ref.current) ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' })\n }\n return (\n <>\n <PriceForecastDetailsBox mb={3} {...args} />\n <FlexCol>\n <ButtonGroup>\n <Button variant=\"contained\" onClick={() => handleClick(forecastPayloadRef)}>\n Forecast Payload\n </Button>\n <Button variant=\"contained\" onClick={() => handleClick(sourcePayloadsRef)}>\n Source Payloads\n </Button>\n </ButtonGroup>\n </FlexCol>\n <pre>\n <Typography ref={forecastPayloadRef}>\n ForecastPayload: <code>{JSON.stringify(args.payload, null, 2)}</code>\n </Typography>\n </pre>\n <pre>\n <Typography ref={sourcePayloadsRef}>\n SourcePayloads: <pre>{JSON.stringify(MockSourcePayloads(), null, 2)}</pre>\n </Typography>\n </pre>\n </>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst WithData = Template.bind({})\nWithData.args = {\n payload: ForecastingDivinerPayload,\n}\n\nexport { Default, WithData }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCI;AAxCJ,sBAAgD;AAEhD,2BAAwB;AACxB,uCAAsC;AACtC,IAAAA,gBAA4C;AAE5C,iBAAmC;AACnC,wBAAwC;AAExC,MAAM,SAAS;AAEf,MAAM,4BAA4B;AAAA,EAChC,QAAQ;AAAA,EACR,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU;AAAA,IAC9C,OAAO;AAAA,IACP,WAAW,KAAK,IAAI,IAAI,SAAS;AAAA,IACjC,OAAO,MAAM;AAAA,EACf,EAAE;AACJ;AAEA,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAoD,CAAC,SAAS;AAClE,QAAM,CAAC,cAAc,eAAe,QAAI,wBAAS,KAAK;AACtD,QAAM,yBAAqB,sBAA6B,IAAI;AAC5D,QAAM,wBAAoB,sBAA6B,IAAI;AAC3D,QAAM,cAAc,CAAC,QAAyC;AAC5D,oBAAgB,CAAC,YAAY;AAC7B,QAAI,IAAI;AAAS,UAAI,QAAQ,eAAe,EAAE,UAAU,UAAU,OAAO,QAAQ,CAAC;AAAA,EACpF;AACA,SACE,4EACE;AAAA,gDAAC,6CAAwB,IAAI,GAAI,GAAG,MAAM;AAAA,IAC1C,4CAAC,gCACC,uDAAC,+BACC;AAAA,kDAAC,0BAAO,SAAQ,aAAY,SAAS,MAAM,YAAY,kBAAkB,GAAG,8BAE5E;AAAA,MACA,4CAAC,0BAAO,SAAQ,aAAY,SAAS,MAAM,YAAY,iBAAiB,GAAG,6BAE3E;AAAA,OACF,GACF;AAAA,IACA,4CAAC,SACC,uDAAC,8BAAW,KAAK,oBAAoB;AAAA;AAAA,MAClB,4CAAC,UAAM,eAAK,UAAU,KAAK,SAAS,MAAM,CAAC,GAAE;AAAA,OAChE,GACF;AAAA,IACA,4CAAC,SACC,uDAAC,8BAAW,KAAK,mBAAmB;AAAA;AAAA,MAClB,4CAAC,SAAK,eAAK,cAAU,+BAAmB,GAAG,MAAM,CAAC,GAAE;AAAA,OACtE,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,WAAW,SAAS,KAAK,CAAC,CAAC;AACjC,SAAS,OAAO;AAAA,EACd,SAAS;AACX;AAKA,IAAO,6BAAQ;","names":["import_react"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, ButtonGroup, Typography } from "@mui/material";
|
|
3
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
|
4
|
+
import { ForecastPayloadSchema } from "@xyo-network/diviner-forecasting-model";
|
|
5
|
+
import { useRef, useState } from "react";
|
|
6
|
+
import { MockSourcePayloads } from "../lib";
|
|
7
|
+
import { PriceForecastDetailsBox } from "./DetailsBox";
|
|
8
|
+
const tenMin = 6e5;
|
|
9
|
+
const ForecastingDivinerPayload = {
|
|
10
|
+
schema: ForecastPayloadSchema,
|
|
11
|
+
values: [1, 2, 3, 4, 5, 6, 7, 8].map((item) => ({
|
|
12
|
+
error: 0,
|
|
13
|
+
timestamp: Date.now() + tenMin * item,
|
|
14
|
+
value: 100 * item
|
|
15
|
+
}))
|
|
16
|
+
};
|
|
17
|
+
const StorybookEntry = {
|
|
18
|
+
argTypes: {},
|
|
19
|
+
component: PriceForecastDetailsBox,
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
page: null
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
title: "plugin/price-forecast/DetailsBox"
|
|
26
|
+
};
|
|
27
|
+
const Template = (args) => {
|
|
28
|
+
const [showPayloads, setShowPayloads] = useState(false);
|
|
29
|
+
const forecastPayloadRef = useRef(null);
|
|
30
|
+
const sourcePayloadsRef = useRef(null);
|
|
31
|
+
const handleClick = (ref) => {
|
|
32
|
+
setShowPayloads(!showPayloads);
|
|
33
|
+
if (ref.current)
|
|
34
|
+
ref.current.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(PriceForecastDetailsBox, { mb: 3, ...args }),
|
|
38
|
+
/* @__PURE__ */ jsx(FlexCol, { children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Button, { variant: "contained", onClick: () => handleClick(forecastPayloadRef), children: "Forecast Payload" }),
|
|
40
|
+
/* @__PURE__ */ jsx(Button, { variant: "contained", onClick: () => handleClick(sourcePayloadsRef), children: "Source Payloads" })
|
|
41
|
+
] }) }),
|
|
42
|
+
/* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsxs(Typography, { ref: forecastPayloadRef, children: [
|
|
43
|
+
"ForecastPayload: ",
|
|
44
|
+
/* @__PURE__ */ jsx("code", { children: JSON.stringify(args.payload, null, 2) })
|
|
45
|
+
] }) }),
|
|
46
|
+
/* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsxs(Typography, { ref: sourcePayloadsRef, children: [
|
|
47
|
+
"SourcePayloads: ",
|
|
48
|
+
/* @__PURE__ */ jsx("pre", { children: JSON.stringify(MockSourcePayloads(), null, 2) })
|
|
49
|
+
] }) })
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
const Default = Template.bind({});
|
|
53
|
+
Default.args = {};
|
|
54
|
+
const WithData = Template.bind({});
|
|
55
|
+
WithData.args = {
|
|
56
|
+
payload: ForecastingDivinerPayload
|
|
57
|
+
};
|
|
58
|
+
var DetailsBox_stories_default = StorybookEntry;
|
|
59
|
+
export {
|
|
60
|
+
Default,
|
|
61
|
+
WithData,
|
|
62
|
+
DetailsBox_stories_default as default
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=DetailsBox.stories.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DetailsBox.stories.tsx"],"sourcesContent":["import { Button, ButtonGroup, Typography } from '@mui/material'\nimport { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { ForecastPayloadSchema } from '@xyo-network/diviner-forecasting-model'\nimport { RefObject, useRef, useState } from 'react'\n\nimport { MockSourcePayloads } from '../lib'\nimport { PriceForecastDetailsBox } from './DetailsBox'\n\nconst tenMin = 600000\n\nconst ForecastingDivinerPayload = {\n schema: ForecastPayloadSchema,\n values: [1, 2, 3, 4, 5, 6, 7, 8].map((item) => ({\n error: 0,\n timestamp: Date.now() + tenMin * item,\n value: 100 * item,\n })),\n}\n\nconst StorybookEntry = {\n argTypes: {},\n component: PriceForecastDetailsBox,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'plugin/price-forecast/DetailsBox',\n} as Meta<typeof PriceForecastDetailsBox>\n\nconst Template: StoryFn<typeof PriceForecastDetailsBox> = (args) => {\n const [showPayloads, setShowPayloads] = useState(false)\n const forecastPayloadRef = useRef<HTMLParagraphElement>(null)\n const sourcePayloadsRef = useRef<HTMLParagraphElement>(null)\n const handleClick = (ref: RefObject<HTMLParagraphElement>) => {\n setShowPayloads(!showPayloads)\n if (ref.current) ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' })\n }\n return (\n <>\n <PriceForecastDetailsBox mb={3} {...args} />\n <FlexCol>\n <ButtonGroup>\n <Button variant=\"contained\" onClick={() => handleClick(forecastPayloadRef)}>\n Forecast Payload\n </Button>\n <Button variant=\"contained\" onClick={() => handleClick(sourcePayloadsRef)}>\n Source Payloads\n </Button>\n </ButtonGroup>\n </FlexCol>\n <pre>\n <Typography ref={forecastPayloadRef}>\n ForecastPayload: <code>{JSON.stringify(args.payload, null, 2)}</code>\n </Typography>\n </pre>\n <pre>\n <Typography ref={sourcePayloadsRef}>\n SourcePayloads: <pre>{JSON.stringify(MockSourcePayloads(), null, 2)}</pre>\n </Typography>\n </pre>\n </>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst WithData = Template.bind({})\nWithData.args = {\n payload: ForecastingDivinerPayload,\n}\n\nexport { Default, WithData }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AAwCI,mBACE,KAEE,YAHJ;AAxCJ,SAAS,QAAQ,aAAa,kBAAkB;AAEhD,SAAS,eAAe;AACxB,SAAS,6BAA6B;AACtC,SAAoB,QAAQ,gBAAgB;AAE5C,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AAExC,MAAM,SAAS;AAEf,MAAM,4BAA4B;AAAA,EAChC,QAAQ;AAAA,EACR,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU;AAAA,IAC9C,OAAO;AAAA,IACP,WAAW,KAAK,IAAI,IAAI,SAAS;AAAA,IACjC,OAAO,MAAM;AAAA,EACf,EAAE;AACJ;AAEA,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAoD,CAAC,SAAS;AAClE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,qBAAqB,OAA6B,IAAI;AAC5D,QAAM,oBAAoB,OAA6B,IAAI;AAC3D,QAAM,cAAc,CAAC,QAAyC;AAC5D,oBAAgB,CAAC,YAAY;AAC7B,QAAI,IAAI;AAAS,UAAI,QAAQ,eAAe,EAAE,UAAU,UAAU,OAAO,QAAQ,CAAC;AAAA,EACpF;AACA,SACE,iCACE;AAAA,wBAAC,2BAAwB,IAAI,GAAI,GAAG,MAAM;AAAA,IAC1C,oBAAC,WACC,+BAAC,eACC;AAAA,0BAAC,UAAO,SAAQ,aAAY,SAAS,MAAM,YAAY,kBAAkB,GAAG,8BAE5E;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,SAAS,MAAM,YAAY,iBAAiB,GAAG,6BAE3E;AAAA,OACF,GACF;AAAA,IACA,oBAAC,SACC,+BAAC,cAAW,KAAK,oBAAoB;AAAA;AAAA,MAClB,oBAAC,UAAM,eAAK,UAAU,KAAK,SAAS,MAAM,CAAC,GAAE;AAAA,OAChE,GACF;AAAA,IACA,oBAAC,SACC,+BAAC,cAAW,KAAK,mBAAmB;AAAA;AAAA,MAClB,oBAAC,SAAK,eAAK,UAAU,mBAAmB,GAAG,MAAM,CAAC,GAAE;AAAA,OACtE,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,WAAW,SAAS,KAAK,CAAC,CAAC;AACjC,SAAS,OAAO;AAAA,EACd,SAAS;AACX;AAKA,IAAO,6BAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var components_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(components_exports);
|
|
18
|
+
__reExport(components_exports, require("./DetailsBox"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./DetailsBox")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './DetailsBox'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,yBAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './DetailsBox'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./components"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./Plugin"), module.exports);
|
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require("./components"),
|
|
23
|
+
...require("./Plugin")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\nexport * from './Plugin'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;AACA,wBAAc,qBADd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\nexport * from './Plugin'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataLineStyles.d.ts","sourceRoot":"","sources":["../../../src/lib/DataLineStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,WAAY,MAAM;;;CAG3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataLineStyles.d.ts","sourceRoot":"","sources":["../../../src/lib/DataLineStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,WAAY,MAAM;;;CAG3C,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var DataLineStyles_exports = {};
|
|
20
|
+
__export(DataLineStyles_exports, {
|
|
21
|
+
DataLineStyles: () => DataLineStyles
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(DataLineStyles_exports);
|
|
24
|
+
var import_material = require("@mui/material");
|
|
25
|
+
const DataLineStyles = (color) => ({
|
|
26
|
+
backgroundColor: color ? (0, import_material.alpha)(color, 0.5) : void 0,
|
|
27
|
+
borderColor: color
|
|
28
|
+
});
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
DataLineStyles
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=DataLineStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/DataLineStyles.ts"],"sourcesContent":["import { alpha } from '@mui/material'\n\nexport const DataLineStyles = (color?: string) => ({\n backgroundColor: color ? alpha(color, 0.5) : undefined,\n borderColor: color,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AAEf,MAAM,iBAAiB,CAAC,WAAoB;AAAA,EACjD,iBAAiB,YAAQ,uBAAM,OAAO,GAAG,IAAI;AAAA,EAC7C,aAAa;AACf;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/DataLineStyles.ts"],"sourcesContent":["import { alpha } from '@mui/material'\n\nexport const DataLineStyles = (color?: string) => ({\n backgroundColor: color ? alpha(color, 0.5) : undefined,\n borderColor: color,\n})\n"],"mappings":"AAAA,SAAS,aAAa;AAEf,MAAM,iBAAiB,CAAC,WAAoB;AAAA,EACjD,iBAAiB,QAAQ,MAAM,OAAO,GAAG,IAAI;AAAA,EAC7C,aAAa;AACf;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DataPointStyles: (pointHoverBackgroundColor?: string) => {
|
|
2
|
+
pointHitRadius: number;
|
|
3
|
+
pointHoverBackgroundColor: string | undefined;
|
|
4
|
+
pointHoverRadius: number;
|
|
5
|
+
pointRadius: number;
|
|
6
|
+
pointStyle: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=DataPointStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataPointStyles.d.ts","sourceRoot":"","sources":["../../../src/lib/DataPointStyles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+BAAgC,MAAM;;;;;;CAMhE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DataPointStyles: (pointHoverBackgroundColor?: string) => {
|
|
2
|
+
pointHitRadius: number;
|
|
3
|
+
pointHoverBackgroundColor: string | undefined;
|
|
4
|
+
pointHoverRadius: number;
|
|
5
|
+
pointRadius: number;
|
|
6
|
+
pointStyle: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=DataPointStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataPointStyles.d.ts","sourceRoot":"","sources":["../../../src/lib/DataPointStyles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+BAAgC,MAAM;;;;;;CAMhE,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var DataPointStyles_exports = {};
|
|
20
|
+
__export(DataPointStyles_exports, {
|
|
21
|
+
DataPointStyles: () => DataPointStyles
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(DataPointStyles_exports);
|
|
24
|
+
const DataPointStyles = (pointHoverBackgroundColor) => ({
|
|
25
|
+
pointHitRadius: 20,
|
|
26
|
+
pointHoverBackgroundColor,
|
|
27
|
+
pointHoverRadius: 10,
|
|
28
|
+
pointRadius: 5,
|
|
29
|
+
pointStyle: "circle"
|
|
30
|
+
});
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
DataPointStyles
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=DataPointStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/DataPointStyles.ts"],"sourcesContent":["export const DataPointStyles = (pointHoverBackgroundColor?: string) => ({\n pointHitRadius: 20,\n pointHoverBackgroundColor,\n pointHoverRadius: 10,\n pointRadius: 5,\n pointStyle: 'circle',\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,kBAAkB,CAAC,+BAAwC;AAAA,EACtE,gBAAgB;AAAA,EAChB;AAAA,EACA,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,YAAY;AACd;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const DataPointStyles = (pointHoverBackgroundColor) => ({
|
|
2
|
+
pointHitRadius: 20,
|
|
3
|
+
pointHoverBackgroundColor,
|
|
4
|
+
pointHoverRadius: 10,
|
|
5
|
+
pointRadius: 5,
|
|
6
|
+
pointStyle: "circle"
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
DataPointStyles
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=DataPointStyles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/DataPointStyles.ts"],"sourcesContent":["export const DataPointStyles = (pointHoverBackgroundColor?: string) => ({\n pointHitRadius: 20,\n pointHoverBackgroundColor,\n pointHoverRadius: 10,\n pointRadius: 5,\n pointStyle: 'circle',\n})\n"],"mappings":"AAAO,MAAM,kBAAkB,CAAC,+BAAwC;AAAA,EACtE,gBAAgB;AAAA,EAChB;AAAA,EACA,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,YAAY;AACd;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
import { ForecastPayload } from '@xyo-network/diviner-forecasting-model';
|
|
3
|
+
import { ChartData, ChartOptions, LegendOptions, ScaleChartOptions } from 'chart.js';
|
|
4
|
+
import { _DeepPartialObject } from 'chart.js/dist/types/utils';
|
|
5
|
+
interface SourcePayloadConfig {
|
|
6
|
+
fetch: boolean;
|
|
7
|
+
sampleSize?: number;
|
|
8
|
+
}
|
|
9
|
+
interface ThemeColors {
|
|
10
|
+
dataSetColorPrimary: string;
|
|
11
|
+
dataSetColorSecondary: string;
|
|
12
|
+
gridColor: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class ForecastLineChartConfigBuilder {
|
|
15
|
+
private payload?;
|
|
16
|
+
data: ChartData<'line'>;
|
|
17
|
+
options: ChartOptions<'line'>;
|
|
18
|
+
themeColors: ThemeColors | undefined;
|
|
19
|
+
constructor(theme: Theme, payload?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
20
|
+
schema: "network.xyo.diviner.forecasting.forecast";
|
|
21
|
+
values: import("@xyo-network/diviner-forecasting-model").Forecast[];
|
|
22
|
+
}) | undefined);
|
|
23
|
+
get forecastPayload(): import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
24
|
+
schema: "network.xyo.diviner.forecasting.forecast";
|
|
25
|
+
values: import("@xyo-network/diviner-forecasting-model").Forecast[];
|
|
26
|
+
};
|
|
27
|
+
static create(theme: Theme, payload?: ForecastPayload, sourcePayloadConfig?: SourcePayloadConfig): Promise<ForecastLineChartConfigBuilder>;
|
|
28
|
+
build(includeSources?: boolean): Promise<this>;
|
|
29
|
+
buildData(includeSources?: boolean): Promise<this>;
|
|
30
|
+
buildOptions(): this;
|
|
31
|
+
refreshValues(): void;
|
|
32
|
+
protected generateLegend(): _DeepPartialObject<LegendOptions<'line'>>;
|
|
33
|
+
protected generateScales(): _DeepPartialObject<ScaleChartOptions<'line'>['scales']>;
|
|
34
|
+
protected generateTitle(): {
|
|
35
|
+
display: boolean;
|
|
36
|
+
text: string;
|
|
37
|
+
};
|
|
38
|
+
protected parseTheme(theme: Theme): {
|
|
39
|
+
dataSetColorPrimary: string;
|
|
40
|
+
dataSetColorSecondary: string;
|
|
41
|
+
gridColor: string;
|
|
42
|
+
};
|
|
43
|
+
private generateDataSetForecastData;
|
|
44
|
+
private generateDataSetSourcePayloads;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=ForecastLineChartConfigBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForecastLineChartConfigBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/ForecastLineChartConfigBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,SAAS,EAAgB,YAAY,EAAE,aAAa,EAAS,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAM9D,UAAU,mBAAmB;IAC3B,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,WAAW;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB;AAWD,qBAAa,8BAA8B;IASvC,OAAO,CAAC,OAAO,CAAC;IARlB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAEtB;IACD,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,CAAmB;IAChD,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;gBAGlC,KAAK,EAAE,KAAK,EACJ,OAAO,CAAC;;;kBAAiB;IAKnC,IAAI,eAAe;;;MAMlB;WAEY,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,eAAe,EAAE,mBAAmB,CAAC,EAAE,mBAAmB;IAUhG,KAAK,CAAC,cAAc,CAAC,EAAE,OAAO;IAM9B,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO;IAsBxC,YAAY;IAUZ,aAAa;IAKb,SAAS,CAAC,cAAc,IAAI,kBAAkB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IASrE,SAAS,CAAC,cAAc,IAAI,kBAAkB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAmBnF,SAAS,CAAC,aAAa;;;;IASvB,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK;;;;;IASjC,OAAO,CAAC,2BAA2B;YAWrB,6BAA6B;CAS5C"}
|