Skip to content

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

Open
benoitcayladbx wants to merge 1 commit into
0.9.0from
fix/frontend-d3-cdn-jsdelivr
Open

benoitcayladbx wants to merge 1 commit into
0.9.0from
fix/frontend-d3-cdn-jsdelivr

Conversation

@benoitcayladbx

Copy link
Copy Markdown
Collaborator

Reopened against 0.9.0 after develop was deleted. GitHub cannot reopen #149 (closed PR + missing base), so this is a successor of #149 with the same commits. Original author: @jeremiaspf. Please rebase onto current 0.9.0 before review — expect conflicts.


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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants