@rm-graph/core 0.1.1 → 0.1.2

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/index.mjs CHANGED
@@ -128,6 +128,24 @@ function hexToRgba(hex, alpha = 1) {
128
128
  }
129
129
 
130
130
  // src/charts/BaseChart.ts
131
+ var SCICHART_VERSION = "3.5.750";
132
+ var sciChartConfigured = false;
133
+ function ensureSciChartConfigured() {
134
+ if (sciChartConfigured) return;
135
+ try {
136
+ SciChartSurface.useWasmFromCDN();
137
+ sciChartConfigured = true;
138
+ } catch {
139
+ try {
140
+ SciChartSurface.configure({
141
+ wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION}/_wasm/scichart2d.wasm`,
142
+ dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION}/_wasm/scichart2d.data`
143
+ });
144
+ sciChartConfigured = true;
145
+ } catch {
146
+ }
147
+ }
148
+ }
131
149
  var BaseChart = class {
132
150
  constructor(config) {
133
151
  this.container = null;
@@ -187,6 +205,7 @@ var BaseChart = class {
187
205
  * Configure SciChart library defaults
188
206
  */
189
207
  configureSciChartDefaults() {
208
+ ensureSciChartConfigured();
190
209
  }
191
210
  /**
192
211
  * Update chart options
@@ -1145,6 +1164,24 @@ async function createHeatmapChart(container, config) {
1145
1164
  await chart.init(container);
1146
1165
  return chart;
1147
1166
  }
1167
+ var SCICHART_VERSION2 = "3.5.750";
1168
+ var sciChart3DConfigured = false;
1169
+ function ensureSciChart3DConfigured() {
1170
+ if (sciChart3DConfigured) return;
1171
+ try {
1172
+ SciChart3DSurface.useWasmFromCDN();
1173
+ sciChart3DConfigured = true;
1174
+ } catch {
1175
+ try {
1176
+ SciChart3DSurface.configure({
1177
+ wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION2}/_wasm/scichart3d.wasm`,
1178
+ dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION2}/_wasm/scichart3d.data`
1179
+ });
1180
+ sciChart3DConfigured = true;
1181
+ } catch {
1182
+ }
1183
+ }
1184
+ }
1148
1185
  var defaultColorStops2 = [
1149
1186
  { offset: 0, color: "#1e3a8a" },
1150
1187
  // Dark blue
@@ -1187,6 +1224,7 @@ var Surface3DChart = class {
1187
1224
  if (!this.container.id) {
1188
1225
  this.container.id = this.id;
1189
1226
  }
1227
+ ensureSciChart3DConfigured();
1190
1228
  await this.createSurface();
1191
1229
  }
1192
1230
  /**
@@ -1344,6 +1382,24 @@ async function createSurface3DChart(container, config) {
1344
1382
  await chart.init(container);
1345
1383
  return chart;
1346
1384
  }
1385
+ var SCICHART_VERSION3 = "3.5.750";
1386
+ var sciChart3DConfigured2 = false;
1387
+ function ensureSciChart3DConfigured2() {
1388
+ if (sciChart3DConfigured2) return;
1389
+ try {
1390
+ SciChart3DSurface.useWasmFromCDN();
1391
+ sciChart3DConfigured2 = true;
1392
+ } catch {
1393
+ try {
1394
+ SciChart3DSurface.configure({
1395
+ wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION3}/_wasm/scichart3d.wasm`,
1396
+ dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION3}/_wasm/scichart3d.data`
1397
+ });
1398
+ sciChart3DConfigured2 = true;
1399
+ } catch {
1400
+ }
1401
+ }
1402
+ }
1347
1403
  var Column3DChart = class {
1348
1404
  constructor(config) {
1349
1405
  this.container = null;
@@ -1374,6 +1430,7 @@ var Column3DChart = class {
1374
1430
  if (!this.container.id) {
1375
1431
  this.container.id = this.id;
1376
1432
  }
1433
+ ensureSciChart3DConfigured2();
1377
1434
  await this.createSurface();
1378
1435
  }
1379
1436
  /**
@@ -1585,15 +1642,15 @@ async function createColumn3DChart(container, config) {
1585
1642
  return chart;
1586
1643
  }
1587
1644
  var VERSION = "0.1.1";
1588
- var SCICHART_VERSION = "3.5.750";
1589
- var DEFAULT_WASM_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION}/_wasm/scichart2d.wasm`;
1590
- var DEFAULT_DATA_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION}/_wasm/scichart2d.data`;
1645
+ var SCICHART_VERSION4 = "3.5.750";
1646
+ var DEFAULT_WASM_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION4}/_wasm/scichart2d.wasm`;
1647
+ var DEFAULT_DATA_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION4}/_wasm/scichart2d.data`;
1591
1648
  var isConfigured = false;
1592
1649
  function autoConfigureSciChart() {
1593
1650
  if (isConfigured) return;
1594
1651
  try {
1595
- const { SciChartSurface: SciChartSurface6 } = __require("scichart");
1596
- SciChartSurface6.configure({
1652
+ const { SciChartSurface: SciChartSurface7 } = __require("scichart");
1653
+ SciChartSurface7.configure({
1597
1654
  wasmUrl: DEFAULT_WASM_URL,
1598
1655
  dataUrl: DEFAULT_DATA_URL
1599
1656
  });
@@ -1604,8 +1661,8 @@ function autoConfigureSciChart() {
1604
1661
  autoConfigureSciChart();
1605
1662
  function configureSciChart(options) {
1606
1663
  try {
1607
- const { SciChartSurface: SciChartSurface6 } = __require("scichart");
1608
- SciChartSurface6.configure({
1664
+ const { SciChartSurface: SciChartSurface7 } = __require("scichart");
1665
+ SciChartSurface7.configure({
1609
1666
  wasmUrl: options.wasmUrl || DEFAULT_WASM_URL,
1610
1667
  dataUrl: options.dataUrl || DEFAULT_DATA_URL
1611
1668
  });