Skip to content

Commit 9a01904

Browse files
authored
feat: Update ChartPanel to use dgrd2 for data display (#4511)
Removes the need for the dgrid-shim workaround fixes #4510 Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent cb9f963 commit 9a01904

7 files changed

Lines changed: 7 additions & 17 deletions

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/layout/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This package is part of the mono repository "@hpcc-js" (aka Visualization Framew
5454
</div>
5555
<script type="module">
5656
import { Column, Pie, Line, Step } from "@hpcc-js/chart";
57-
import { Carousel } from "@hpcc-js/layout"; // Has dependency on "dgrid" so can't be used in a module...
57+
import { Carousel } from "@hpcc-js/layout";
5858

5959
const columns = ["Subject", "Year 1", "Year 2", "Year 3"];
6060
const data = [

packages/layout/index-preview.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
margin-top: 20px;
2424
}
2525
</style>
26-
<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/dgrid-shim/dist/index.min.js"></script>
2726
<script type="importmap">
2827
{
2928
"imports": {
@@ -36,7 +35,6 @@
3635
"@hpcc-js/chart": "../chart/dist/index.js",
3736
"@hpcc-js/codemirror": "../codemirror/dist/index.js",
3837
"@hpcc-js/comms": "../comms/dist/index.js",
39-
"@hpcc-js/dgrid": "../dgrid/dist/index.js",
4038
"@hpcc-js/dgrid2": "../dgrid2/dist/index.js",
4139
"@hpcc-js/react": "../react/dist/index.js",
4240
"@hpcc-js/html": "../html/dist/index.js",

packages/layout/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
margin-top: 20px;
2424
}
2525
</style>
26-
<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/dgrid-shim/dist/index.min.js"></script>
2726
</head>
2827

2928
<body onresize="doResize()">

packages/layout/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@hpcc-js/api": "^3.4.5",
4141
"@hpcc-js/chart": "^3.6.1",
4242
"@hpcc-js/common": "^3.6.1",
43-
"@hpcc-js/dgrid": "^3.5.5",
43+
"@hpcc-js/dgrid2": "^3.5.3",
4444
"@hpcc-js/util": "^3.4.4"
4545
},
4646
"devDependencies": {
@@ -64,4 +64,4 @@
6464
"url": "https://github.com/hpcc-systems/Visualization/issues"
6565
},
6666
"homepage": "https://github.com/hpcc-systems/Visualization"
67-
}
67+
}

packages/layout/src/ChartPanel.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { IHighlight } from "@hpcc-js/api";
22
import { Button, Database, IconBar, ProgressBar, Spacer, SVGWidget, Text, TitleBar, ToggleButton, Utility, Widget } from "@hpcc-js/common";
3-
import type { XYAxis } from "@hpcc-js/chart";
4-
import { Table } from "@hpcc-js/dgrid";
3+
import { Table } from "@hpcc-js/dgrid2";
54
import { select as d3Select } from "d3-selection";
65
import { Border2 } from "./Border2.ts";
76
import { Carousel } from "./Carousel.ts";
@@ -100,7 +99,7 @@ export class ChartPanel<T extends Widget = Widget> extends Border2 implements IH
10099
protected _table = new Table();
101100
protected _widget: T;
102101

103-
protected _hideLegendToggleList = ["dgrid_Table"];
102+
protected _hideLegendToggleList = ["dgrid_Table", "dgrid2_Table"];
104103

105104
constructor() {
106105
super();

packages/layout/tests/layout.browser.spec.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@ import { Class, EntityCard, HTMLWidget, Icon, SVGWidget } from "@hpcc-js/common"
22
import { Bar, Column, Line, Pie, Step } from "@hpcc-js/chart";
33
import { describe, it, expect } from "vitest";
44
import { classDef, data, render } from "../../common/tests/index.ts";
5-
import { load_dgrid_shim } from "../../dgrid/tests/index.ts";
65

76
const urlSearch: string = "";
87

98
describe("@hpcc-js/layout", async () => {
10-
await load_dgrid_shim();
11-
12-
it("Shim Loaded", () => {
13-
expect(globalThis["@hpcc-js/dgrid-shim"]).to.exist;
14-
});
15-
169
const layoutMod = await import("@hpcc-js/layout");
1710

18-
it("dgridMod Loaded", () => {
11+
it("layoutMod Loaded", () => {
1912
expect(layoutMod).to.exist;
2013
});
2114

0 commit comments

Comments
 (0)