D3 support modular development For example you can import specific parts don t have to use everything very flexible for example if you just want to use the color or axis components import as d3collection from https unpkg com d3 collection module entries keys map nest set values import as d3selection from https unpkg com d3 selection module select selectAll import as d3scale from https unpkg com d3 scale module scaleLinear scaleTime scaleOrdinal import as d3axis from https unpkg com d3 axis module axisBottom axisLeft axisRight import as d3shape from https unpkg com d3 shape module arc area areaRadial curveBasis import as d3array from https unpkg com d3 array module Adder InternMap InternSet ascending bin import as d3request from https unpkg com d3 request module csv html json request text import as d3time from https unpkg com d3 time format module isoFormat isoParse timeFormat timeFormatDefaultLocale import as d3format from https unpkg com d3 format module FormatSpecifier format formatDefaultLocale formatLocale import as d3geo from https unpkg com d3 geo module geoAlbers geoAlbersUsa geoArea geoAzimuthalEqualArea geoAzimuthalEqualAreaRaw geoAzimuthalEquidistant geoAzimuthalEquidistantRaw import as d3geoprojection from https unpkg com d3 geo projection module geoAiry geoAiryRaw geoAitoff geoAitoffRaw If you want to list all of the available items for a module console log d3request Object keys d3request d3 modular you can of course load all resize working frame window window frameElement style height 200px import as d3 from https cdn skypack dev d3 7 if you want to see the extensive list of the d3 library console log d3 Object keys d3 d3 select body append h3 text Hello world d3 select h3 style color darkblue d3 select h3 style font size 24px console log ready Go through all the d3 modules and dynamically load them then list how many accessor keys are available for each one let modules d3 array d3 axis d3 brush d3 chord d3 color d3 contour d3 delaunay d3 dispatch d3 drag d3 dsv d3 ease d3 fetch d3 force d3 format d3 geo d3 hierarchy d3 interpolate d3 path d3 polygon d3 quadtree d3 random d3 scale d3 scale chromatic d3 selection d3 shape d3 time d3 time format d3 timer d3 transition d3 zoom for let i 0 i modules length i let fullpath https unpkg com modules i module const tmp await import fullpath console log module modules i num keys Object keys tmp length console log ready Importing individual modules and combining them into a d3 object using Object assign const d3 await Promise all import https unpkg com d3 format module import https unpkg com d3 geo module import https unpkg com d3 geo projection module then d3 Object assign d3 console log ready script src https cdn jsdelivr net npm d3 7 script script console log d3 version d3 version console log ready script
ular you can of course load all resize working frame window window frameElement style height 200px import as d3 from https cdn skypack dev d3 7 if you want to see the extensive list of the d3 library console log d3 Object keys d3 d3 select body append h3 text Hello world d3 select h3 style color darkblue d3 select h3 style font size 24px console log ready Go through all the d3 modules and dynamically load them then list how many accessor keys are available for each one let modules d3 array d3 axis d3 brush d3 chord d3 color d3 contour d3 delaunay d3 dispatch d3 drag d3 dsv d3 ease d3 fetch d3 force d3 format d3 geo d3 hierarchy d3 interpolate d3 path d3 polygon d3 quadtree d3 random d3 scale d3 scale chromatic d3 selection d3 shape d3 time d3 time format d3 timer d3 transition d3 zoom for let i 0 i modules length i let fullpath https unpkg com modules i module const tmp await import fullpath console log module modules i num keys Object keys tmp length console log ready Importing individual modules and combining them into a d3 object using Object assign const d3 await Promise all import https unpkg com d3 format module import https unpkg com d3 geo module import https unpkg com d3 geo projection module then d3 Object assign d3 console log ready script src https cdn jsdelivr net npm d3 7 script script console log d3 version d3 version console log ready script