Skip to content

fix(frontend): load D3.js from jsdelivr instead of d3js.org - #149

Open
jeremiaspf wants to merge 1 commit into
databrickslabs:developfrom
jeremiaspf:fix/frontend-d3-cdn-jsdelivr
Open

fix(frontend): load D3.js from jsdelivr instead of d3js.org#149
jeremiaspf wants to merge 1 commit into
databrickslabs:developfrom
jeremiaspf:fix/frontend-d3-cdn-jsdelivr

Conversation

@jeremiaspf

Copy link
Copy Markdown

What

Switches D3.js from https://d3js.org/d3.v7.min.js to https://cdn.jsdelivr.net/npm/d3@7/dist/d3.min.js in every file that loads it:

  • src/front/static/query/js/query-ontology-viewer.js (Query → Ontology Viewer)
  • src/front/static/query/js/query-sigmagraph.js (query result graph, Sigma.js)
  • src/front/static/registry/js/registry.js (Registry bridges map)
  • src/front/templates/partials/ontology/_ontology_map.html (ontology map template)
  • src/front/templates/partials/mapping/_mapping_design.html (Mapping designer panel template)

(src/front/static/ontology/js/ontology-swrl.js gets the same change as part of the companion Designer-UI PR, since that file needed unrelated fixes too.)

Why

d3js.org is blocked in networks with restricted outbound access — which is common for Databricks Apps deployed in corporate environments. When that happens, every D3-based visualization fails to load entirely: the SWRL rule graph, the ontology viewer, the query result graph, the Registry bridges map, and the Mapping designer map. jsDelivr resolves cleanly in those environments and serves the same D3 v7 build.

How to test

In an environment where d3js.org is blocked (or simulate by blocking it at the OS/proxy level), open any of the five screens above — they should render their D3 visualization instead of failing silently.

query-ontology-viewer.js, query-sigmagraph.js, registry.js,
_ontology_map.html and _mapping_design.html all load D3.js from
https://d3js.org/d3.v7.min.js. In networks where d3js.org is blocked —
common in corporate environments with restricted outbound access, as is
typical for Databricks Apps — every D3-based visualization these files
power (ontology viewer, query result graph, Registry bridges map,
mapping designer map) fails to load at all.

Switching to https://cdn.jsdelivr.net/npm/d3@7/dist/d3.min.js resolves
this in those environments. ontology-swrl.js gets the same change as
part of the companion Designer-UI PR, since it also needed unrelated
fixes there.
@jeremiaspf
jeremiaspf requested a review from a team as a code owner August 22, 2026 09:27
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@benoitcayladbx benoitcayladbx self-assigned this Aug 23, 2026
@benoitcayladbx benoitcayladbx added this to the v0.8.0 milestone Aug 23, 2026

@benoitcayladbx benoitcayladbx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — relevant and still needed on develop. d3js.org is still the D3 URL in every call site you listed, and jsDelivr is already the CDN we use for Bootstrap / Chart.js / marked, so this is the right direction.

Rules that still need a pass

Incomplete change (same bug remains elsewhere). src/front/static/ontology/js/ontology-swrl.js still loads https://d3js.org/d3.v7.min.js in _ensureD3(). You noted a companion Designer PR; please fold that last call site into this PR so a restricted network cannot still break the SWRL graph. Grep for d3js.org should return zero hits under src/.

Changelog (.cursorrules + .cursor/08-testing-and-deployment.mdc). After any code change, add a section under changelogs/v0.8.0/<github-user>_YYYY-MM-DD.log (English): title, context, numbered file list, modified files, test result.

Docs (.cursor/08 §Documentation Rules). If D3 is listed as a dependency with the old URL (Sphinx documentation/sphinx / development guides), update the link to jsDelivr so the docs match runtime.

CLA. The CLA assistant is still pending on this PR — please sign / recheck so we can merge.

Guidance

  • Keep the unpkg/jsDelivr URL pinned to D3 v7 (d3@7) as you did; do not float to latest major.
  • Optional follow-up (not blocking): vendor D3 under src/front/static/ so Databricks Apps with all public CDNs blocked still render. Out of scope here if jsDelivr is already allowed for Bootstrap.

Once the SWRL call site + changelog (and CLA) are in, this is mergeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants