@rm-graph/core 0.1.0 → 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.d.mts CHANGED
@@ -532,19 +532,21 @@ declare function hexToRgba(hex: string, alpha?: number): string;
532
532
  * @packageDocumentation
533
533
  */
534
534
 
535
- declare const VERSION = "0.1.0";
535
+ declare const VERSION = "0.1.1";
536
536
 
537
537
  /**
538
538
  * Configure SciChart WebAssembly location
539
- * Call this before creating any charts if you need to customize the WASM location
539
+ * By default, the package auto-configures to use CDN.
540
+ * Call this to override with custom paths.
540
541
  *
541
542
  * @example
542
543
  * ```ts
543
- * import { configureSciChart } from '@scichart-ui/core';
544
+ * import { configureSciChart } from '@rm-graph/core';
544
545
  *
546
+ * // Use local WASM files
545
547
  * configureSciChart({
546
- * wasmUrl: '/path/to/scichart2d.wasm',
547
- * dataUrl: '/path/to/scichart2d.data'
548
+ * wasmUrl: '/scichart2d.wasm',
549
+ * dataUrl: '/scichart2d.data'
548
550
  * });
549
551
  * ```
550
552
  */
package/dist/index.d.ts CHANGED
@@ -532,19 +532,21 @@ declare function hexToRgba(hex: string, alpha?: number): string;
532
532
  * @packageDocumentation
533
533
  */
534
534
 
535
- declare const VERSION = "0.1.0";
535
+ declare const VERSION = "0.1.1";
536
536
 
537
537
  /**
538
538
  * Configure SciChart WebAssembly location
539
- * Call this before creating any charts if you need to customize the WASM location
539
+ * By default, the package auto-configures to use CDN.
540
+ * Call this to override with custom paths.
540
541
  *
541
542
  * @example
542
543
  * ```ts
543
- * import { configureSciChart } from '@scichart-ui/core';
544
+ * import { configureSciChart } from '@rm-graph/core';
544
545
  *
546
+ * // Use local WASM files
545
547
  * configureSciChart({
546
- * wasmUrl: '/path/to/scichart2d.wasm',
547
- * dataUrl: '/path/to/scichart2d.data'
548
+ * wasmUrl: '/scichart2d.wasm',
549
+ * dataUrl: '/scichart2d.data'
548
550
  * });
549
551
  * ```
550
552
  */
package/dist/index.js 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
+ scichart.SciChartSurface.useWasmFromCDN();
137
+ sciChartConfigured = true;
138
+ } catch {
139
+ try {
140
+ scichart.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
+ scichart.SciChart3DSurface.useWasmFromCDN();
1173
+ sciChart3DConfigured = true;
1174
+ } catch {
1175
+ try {
1176
+ scichart.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
+ scichart.SciChart3DSurface.useWasmFromCDN();
1391
+ sciChart3DConfigured2 = true;
1392
+ } catch {
1393
+ try {
1394
+ scichart.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
  /**
@@ -1584,14 +1641,33 @@ async function createColumn3DChart(container, config) {
1584
1641
  await chart.init(container);
1585
1642
  return chart;
1586
1643
  }
1587
- var VERSION = "0.1.0";
1644
+ var VERSION = "0.1.1";
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`;
1648
+ var isConfigured = false;
1649
+ function autoConfigureSciChart() {
1650
+ if (isConfigured) return;
1651
+ try {
1652
+ const { SciChartSurface: SciChartSurface7 } = chunkKATRK3C3_js.__require("scichart");
1653
+ SciChartSurface7.configure({
1654
+ wasmUrl: DEFAULT_WASM_URL,
1655
+ dataUrl: DEFAULT_DATA_URL
1656
+ });
1657
+ isConfigured = true;
1658
+ } catch {
1659
+ }
1660
+ }
1661
+ autoConfigureSciChart();
1588
1662
  function configureSciChart(options) {
1589
- if (options.wasmUrl || options.dataUrl) {
1590
- const { SciChartSurface: SciChartSurface6 } = chunkKATRK3C3_js.__require("scichart");
1591
- SciChartSurface6.configure({
1592
- wasmUrl: options.wasmUrl,
1593
- dataUrl: options.dataUrl
1663
+ try {
1664
+ const { SciChartSurface: SciChartSurface7 } = chunkKATRK3C3_js.__require("scichart");
1665
+ SciChartSurface7.configure({
1666
+ wasmUrl: options.wasmUrl || DEFAULT_WASM_URL,
1667
+ dataUrl: options.dataUrl || DEFAULT_DATA_URL
1594
1668
  });
1669
+ isConfigured = true;
1670
+ } catch {
1595
1671
  }
1596
1672
  }
1597
1673