@rm-graph/core 0.1.3 → 0.1.5

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.js CHANGED
@@ -857,6 +857,21 @@ async function createColumn3DChart(container, config) {
857
857
  await chart.init(container);
858
858
  return chart;
859
859
  }
860
+ var SCICHART_VERSION4 = "4.0.933";
861
+ var sciChartConfigured2 = false;
862
+ var configureSciChartCDN = () => {
863
+ if (sciChartConfigured2) return;
864
+ try {
865
+ const cdnBase = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION4}/_wasm`;
866
+ scichart.SciChartSurface.configure({
867
+ wasmUrl: `${cdnBase}/scichart2d.wasm`,
868
+ dataUrl: `${cdnBase}/scichart2d.data`
869
+ });
870
+ sciChartConfigured2 = true;
871
+ } catch (e) {
872
+ console.warn("Failed to configure SciChart CDN:", e);
873
+ }
874
+ };
860
875
  var HORIZONTAL_RESOLUTION = 360;
861
876
  var VERTICAL_SCALE_MAX_DEFAULT = 5e3;
862
877
  var HORIZONTAL_RESOLUTION_MULTIPLIER = 1;
@@ -1038,6 +1053,7 @@ var PRPDChart = class {
1038
1053
  if (!this.container || !this.chartHost) {
1039
1054
  throw new Error("Container not set");
1040
1055
  }
1056
+ configureSciChartCDN();
1041
1057
  const theme = createPRPDTheme();
1042
1058
  const { sciChartSurface, wasmContext } = await scichart.SciChartSurface.create(
1043
1059
  this.chartHost,
@@ -1365,30 +1381,49 @@ var PRPDChart = class {
1365
1381
  */
1366
1382
  destroy() {
1367
1383
  if (this.isDestroyed) return;
1368
- this.clearHeatmapLegend();
1369
- if (this.sineLineSeries && this.surface) {
1370
- this.surface.renderableSeries.remove(this.sineLineSeries);
1371
- this.sineLineSeries.delete();
1372
- this.sineLineSeries = null;
1384
+ this.isDestroyed = true;
1385
+ try {
1386
+ this.clearHeatmapLegend();
1387
+ } catch (e) {
1373
1388
  }
1374
- if (this.sineDataSeries) {
1375
- this.sineDataSeries.delete();
1376
- this.sineDataSeries = null;
1389
+ try {
1390
+ if (this.sineLineSeries && this.surface) {
1391
+ this.surface.renderableSeries.remove(this.sineLineSeries);
1392
+ this.sineLineSeries.delete();
1393
+ }
1394
+ } catch (e) {
1377
1395
  }
1378
- if (this.heatmapSeries && this.surface) {
1379
- this.surface.renderableSeries.remove(this.heatmapSeries);
1380
- this.heatmapSeries.delete();
1381
- this.heatmapSeries = null;
1396
+ this.sineLineSeries = null;
1397
+ try {
1398
+ if (this.sineDataSeries) {
1399
+ this.sineDataSeries.delete();
1400
+ }
1401
+ } catch (e) {
1382
1402
  }
1383
- if (this.heatmapDataSeries) {
1384
- this.heatmapDataSeries.delete();
1385
- this.heatmapDataSeries = null;
1403
+ this.sineDataSeries = null;
1404
+ try {
1405
+ if (this.heatmapSeries && this.surface) {
1406
+ this.surface.renderableSeries.remove(this.heatmapSeries);
1407
+ this.heatmapSeries.delete();
1408
+ }
1409
+ } catch (e) {
1386
1410
  }
1387
- if (this.surface) {
1388
- this.surface.delete();
1389
- this.surface = null;
1411
+ this.heatmapSeries = null;
1412
+ try {
1413
+ if (this.heatmapDataSeries) {
1414
+ this.heatmapDataSeries.delete();
1415
+ }
1416
+ } catch (e) {
1390
1417
  }
1391
- this.isDestroyed = true;
1418
+ this.heatmapDataSeries = null;
1419
+ try {
1420
+ if (this.surface) {
1421
+ this.surface.chartModifiers.clear();
1422
+ this.surface.delete();
1423
+ }
1424
+ } catch (e) {
1425
+ }
1426
+ this.surface = null;
1392
1427
  }
1393
1428
  };
1394
1429
  async function createPRPDChart(container, config) {
@@ -1397,8 +1432,8 @@ async function createPRPDChart(container, config) {
1397
1432
  return chart;
1398
1433
  }
1399
1434
  var VERSION = "0.1.1";
1400
- var SCICHART_VERSION4 = "4.0.933";
1401
- var DEFAULT_WASM_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION4}/_wasm/scichart2d.wasm`;
1435
+ var SCICHART_VERSION5 = "4.0.933";
1436
+ var DEFAULT_WASM_URL = `https://cdn.jsdelivr.net/npm/scichart@${SCICHART_VERSION5}/_wasm/scichart2d.wasm`;
1402
1437
  var isConfigured = false;
1403
1438
  function autoConfigureSciChart() {
1404
1439
  if (isConfigured) return;