From 2af3d54a7ac7af1cffa0a9b150dba40db6c687da Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 5 Mar 2024 21:22:48 -0800 Subject: [PATCH] unpin echarts --- docs/lib/echarts.md | 4 ++-- src/libraries.ts | 2 +- src/npm.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/lib/echarts.md b/docs/lib/echarts.md index 9c21d294b..3303324c3 100644 --- a/docs/lib/echarts.md +++ b/docs/lib/echarts.md @@ -6,8 +6,8 @@ index: true Apache ECharts is available by default as `echarts` in Markdown. You can also import it explicitly like so: -```js run=false -import * as echarts from "npm:echarts/dist/echarts.esm.js"; +```js echo +import * as echarts from "npm:echarts"; ``` To use ECharts, declare a container element with the desired dimensions, [display it](../javascript/display), and then call `echarts.init`. diff --git a/src/libraries.ts b/src/libraries.ts index c288716d4..d28a60fb2 100644 --- a/src/libraries.ts +++ b/src/libraries.ts @@ -20,7 +20,7 @@ export function getImplicitInputImports(inputs: Iterable): Set { if (set.has("dot")) implicits.add("npm:@observablehq/dot"); if (set.has("duckdb")) implicits.add("npm:@duckdb/duckdb-wasm"); if (set.has("DuckDBClient")) implicits.add("npm:@observablehq/duckdb"); - if (set.has("echarts")) implicits.add("npm:echarts/dist/echarts.esm.min.js"); + if (set.has("echarts")) implicits.add("npm:echarts"); if (set.has("htl") || set.has("html") || set.has("svg")) implicits.add("npm:htl"); if (set.has("Inputs")) implicits.add("npm:@observablehq/inputs"); if (set.has("L")) implicits.add("npm:leaflet"); diff --git a/src/npm.ts b/src/npm.ts index 1e0ff57e5..e2467f7ed 100644 --- a/src/npm.ts +++ b/src/npm.ts @@ -171,11 +171,11 @@ export async function resolveNpmImport(root: string, specifier: string): Promise ? "13.0.0" // https://github.com/observablehq/framework/issues/750 : name === "parquet-wasm" ? "0.5.0" // https://github.com/observablehq/framework/issues/733 - : name === "echarts" - ? "5.4.3" // https://github.com/observablehq/framework/pull/811 : undefined, path = name === "mermaid" - ? "dist/mermaid.esm.min.mjs/+esm" // TODO + ? "dist/mermaid.esm.min.mjs/+esm" + : name === "echarts" + ? "dist/echarts.esm.min.js" : "+esm" } = parseNpmSpecifier(specifier); return `/_npm/${name}@${await resolveNpmVersion(root, {name, range})}/${path.replace(/\+esm$/, "+esm.js")}`;