Skip to content

Commit 466092b

Browse files
mbostockFil
andauthored
unpin echarts (#987)
* unpin echarts * fix tests * clean up call in recommendedLibraries * add a link to the ECharts website * hyphenate “open-source” --------- Co-authored-by: Philippe Rivière <[email protected]>
1 parent d0fae89 commit 466092b

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

docs/lib/echarts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ index: true
44

55
# Apache ECharts
66

7-
Apache ECharts is available by default as `echarts` in Markdown. You can also import it explicitly like so:
7+
[Apache ECharts](https://echarts.apache.org), an open-source JavaScript visualization library, is available by default as `echarts` in Markdown. You can also import it explicitly like so:
88

99
```js run=false
10-
import * as echarts from "npm:echarts/dist/echarts.esm.js";
10+
import * as echarts from "npm:echarts";
1111
```
1212

1313
To use ECharts, declare a container element with the desired dimensions, [display it](../javascript/display), and then call `echarts.init`.

src/client/stdlib/recommendedLibraries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const d3 = () => import("npm:d3");
55
export const dot = () => import("observablehq:stdlib/dot").then((dot) => dot.default);
66
export const duckdb = () => import("npm:@duckdb/duckdb-wasm");
77
export const DuckDBClient = () => import("observablehq:stdlib/duckdb").then((duckdb) => duckdb.DuckDBClient);
8-
export const echarts = () => import("npm:echarts/dist/echarts.esm.min.js");
8+
export const echarts = () => import("npm:echarts");
99
export const htl = () => import("npm:htl");
1010
export const html = () => import("npm:htl").then((htl) => htl.html);
1111
export const svg = () => import("npm:htl").then((htl) => htl.svg);

src/libraries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function getImplicitInputImports(inputs: Iterable<string>): Set<string> {
2020
if (set.has("dot")) implicits.add("npm:@observablehq/dot");
2121
if (set.has("duckdb")) implicits.add("npm:@duckdb/duckdb-wasm");
2222
if (set.has("DuckDBClient")) implicits.add("npm:@observablehq/duckdb");
23-
if (set.has("echarts")) implicits.add("npm:echarts/dist/echarts.esm.min.js");
23+
if (set.has("echarts")) implicits.add("npm:echarts");
2424
if (set.has("htl") || set.has("html") || set.has("svg")) implicits.add("npm:htl");
2525
if (set.has("Inputs")) implicits.add("npm:@observablehq/inputs");
2626
if (set.has("L")) implicits.add("npm:leaflet");

src/npm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ export async function resolveNpmImport(root: string, specifier: string): Promise
171171
? "13.0.0" // https://github.com/observablehq/framework/issues/750
172172
: name === "parquet-wasm"
173173
? "0.5.0" // https://github.com/observablehq/framework/issues/733
174-
: name === "echarts"
175-
? "5.4.3" // https://github.com/observablehq/framework/pull/811
176174
: undefined,
177175
path = name === "mermaid"
178-
? "dist/mermaid.esm.min.mjs/+esm" // TODO
176+
? "dist/mermaid.esm.min.mjs/+esm"
177+
: name === "echarts"
178+
? "dist/echarts.esm.min.js"
179179
: "+esm"
180180
} = parseNpmSpecifier(specifier);
181181
return `/_npm/${name}@${await resolveNpmVersion(root, {name, range})}/${path.replace(/\+esm$/, "+esm.js")}`;

test/mocks/jsdelivr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const packages: [name: string, version: string][] = [
1010
["canvas-confetti", "1.9.2"],
1111
["d3-dsv", "3.0.1"],
1212
["d3", "7.8.5"],
13+
["echarts", "5.5.0"],
1314
["exceljs", "4.4.0"],
1415
["htl", "0.3.1"],
1516
["jszip", "3.10.1"],

0 commit comments

Comments
 (0)