Questions tagged [d3]

D3.js is a small, open-source JavaScript visualization library for manipulating HTML and SVG documents based on data

Filter by
Sorted by
Tagged with
1
vote
1answer
173 views

Leaflet map with D3.js dynamic graph from geojson data

I build a Leaflet map and display data from a GeoJSON. I add a Leaflet-Sidebar to my map, and embed the info control inside this sidebar. When a user hovering polygons on the map, raw values are ...
1
vote
1answer
37 views

How to show Puerto Rico in “albersUsa” projection in Vega-Lite or Vega?

I have a shapefile that has all the US counties along with Puerto Rico and I want to visualize them in "albersUsa" projection using Vega or Vega-Lite. Problem is that in other projections, ...
0
votes
0answers
82 views

Can't correctly display GeoJSON on D3

I'm trying to display some GeoJSON files with D3. The code is pretty simple: import europe_data from "./data/europe.json"; import areas_data from "./data/LV.json"; /**********************************...
1
vote
0answers
23 views

D3.json doesn't fetch data but no error [closed]

I am trying to load a geojson file. I get an error (404) if the file doesn't exist but nothing happens if the file exists. I have tried different versions of D3 ... v3, v4, v5 console.log("hello"); //...
0
votes
0answers
73 views

Add new values to properties of a GeoJSON by matching the name on an array with objects

I have an array of objects with the following structure: population = [{county: "Alachua", population: 269956} {county: "Baker", population: 28355} {county: "Bay", population: 185287}...
1
vote
1answer
83 views

Combine D3 node and HTML

I followed this example of putting a d3 graph in a leaflet popup. The code returns with div.node(). What exactly is a node? I would like the Leaflet Popup To display this custom HTML, and then have ...
1
vote
0answers
90 views

Drawing the Tropics on D3.js geojson using Linestring

I am using the geoMercator projection on D3.js and want to draw the Tropic of Cancer and Tropic of Capricorn on my map. Right now I added the Equator using plot.append("path") .datum({type: "...
1
vote
0answers
373 views

How to create dashboard combining maps and charts open source way?

As far as I am aware there is no open source user interface (framework) which would allow easily design website as combination of interactive maps and charts like ArcGIS dashboard tool does. And you ...
1
vote
0answers
46 views

Use a WFS-T layer in d3.js without adding a background map?

I am currently working on a d3.js project and would like to include a WFS-T layer to my SVG map to display and update location data stored in a PostGIS database. I know that I need to transform my ...
1
vote
1answer
214 views

Scale and fit GeoJSON to the SVG map with d3-geo

I am trying to follow the excellent tutorial by Mike Bostock on medium with my own data. Instead of a GeoJSON of California, I am trying to fit a small parcel somewhere in Norway to the map. My ...
1
vote
0answers
140 views

Contours generated in Leaflet losing coordinates?

I am attempting to use a JavaScript library to generate contours in a leaflet map from a point layer on the map. I have tried this approach with d3 and turf and am getting the same issue where the ...
5
votes
2answers
87 views

Removing space between objects of a shapefile

I'm trying to visualise the results french presidential elections of 2017 by departements. I found a shapefile of France with departements here When I try to export this file in TopoJSON format from ...
1
vote
0answers
521 views

Leaflet load CSV file [closed]

I want my CSV file load on the map, and catch my current location at the same time. Now, I can't load CSV successfully. This is my code: <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">...
0
votes
1answer
123 views

Replicating standard D3.js Conical US Albers projection in QGIS?

Oftentimes, when I see maps of the US rendered online, they use a custom version of the Albers projection, like so: Alaska and Hawaii are off to the side, nicely arranged. I'd like to replicate this ...
0
votes
0answers
370 views

Custom SVG world map usable for react-simple-maps (topojson, d3-geo)?

A client has supplied a "custom" SVG containing a very detailed world map that includes id's for all countries. I'm not sure how "custom" it is. Is it at all possible to convert it to topojson, which ...
0
votes
2answers
181 views

Mapbox GL JS - Trouble Loading Data to Create Layer

I am new to Mapbox GL JS and working with starter code from "Create a Time Slider" below: https://docs.mapbox.com/mapbox-gl-js/example/timeline-animation/ To pull in the data, the code uses d3.json ...
0
votes
2answers
251 views

Zoom to points using d3SvgOverlay

I have an application where a csv file is filtered and the filtered data is displayed on a leaflet map. What I would like to happen is for the map to zoom in to the points. I have tried using ...
0
votes
1answer
266 views

Adjusting Alaska and Hawai in d3

I am quite new to d3 and I am trying to make a choropleth map of the US. But my point is how to adjust Alaska and Hawaii in the final map. In the past I used to do this in Illustrator, but I am not ...
1
vote
1answer
252 views

Building choropleth map using D3.js? [closed]

I want to build a Choropleth map, from a specific region (in my case Portugal) with D3.JS and while searching for tutorials and support, I have found this website. Following the procedure, I have ...
2
votes
1answer
815 views

Drawing a GeoJSON with D3js on OpenLayers 4

The goal is to interact with the DOM based on users input using JavaScript. I have now considered using D3js (v5) to draw the points. Without the base vector layers (loaded as a geojson) and ...
1
vote
0answers
337 views

Show tooltip on the D3 map

I've created a basic map using D3 with countries GeoJSON. Here is the demo. Now when the user clicks on any coordinate on the map, I am showing a weather info within a tooltip with weather icon as a ...
1
vote
1answer
629 views

Choropleth map from voronoi map from a set of coordinates (d3+leaflet)

I have a csv file with a set of coordinates with the following structure: id,name,latitude,longitude (24 values). Those 24 points represent coordinates in a city. I would like to get a voronoi map ...
1
vote
0answers
213 views

Making a choropleth in D3 by intersecting a MultiPolygon and a Point GeoJSON

I am trying to generate a choropleth map showing crimes per neighborhoods: I have a layer showing the neighborhood boundaries of the city of San Francisco, and point data showing incidences of crime ...
0
votes
1answer
299 views

Difficulty rendering a multipolygon from a GeoJSON using JQuery

I'm pulling polygon data (neighborhood boundaries in San Francisco) from an API on https://data.sfgov.org/Geographic-Locations-and-Boundaries/SF-Find-Neighborhoods/pty2-tcw4/data. While I made sure on ...
2
votes
2answers
377 views

Natural earth tiles are not detailed enough

I am new to GIS, but I have been using the following set of tiles in some of my D3 applications: .tiles.mapbox.com/v3/mapbox.natural-earth-2/ The issue with these tiles is that they are not too '...
0
votes
1answer
459 views

Project UTM Coordinates to three.js Coordinates With D3

I've been working on an application where I am building a 3d terrain, using three.js. The part I have working so far is building the 3d terrain mesh from standard 30m elevation data, and then draping ...
2
votes
1answer
900 views

D3 Map + TopoJSON (mapshaper) showing empty

Just started learn D3.js and TopoJSON. I had shapefile files and converted using mapshaper to TopoJSON, but when I tried on my local server my map showing empty page without any errors. I don't have ...
1
vote
0answers
251 views

Making bar charts with values in popup windows in web map using QGIS?

I'm an amateur of QGIS. I've set up a map with a bar chart overlay. However, there are some charts overlaying each other. So I would like to create a map which when people click / however an area on ...
1
vote
0answers
280 views

Leaflet+D3 how to show multiple layers as plane with markers on it

I'm trying to draw map which looks similar to 3 Dimensional. It has 3 layers bottom most is base layer which is OSM map layer. 2 and 3 is svg layer. as shown in below diagram, I'm able to tilt/rotate ...
2
votes
1answer
306 views

D3 Projection outputs Map wrong

I made a map with qgis. Unfortunately when I want to render the map with d3 map renderer, it shows weird structures. The map is in "1:116'622'714" scale. Could this be a problem? The website should ...
1
vote
0answers
432 views

d3.js rectangle feature plotted as arc in Mollweide projection [closed]

I am trying to plot a rectangle using d3.js under the Mollweide projection. However, when I run the following script the rectangle appears as an arc or curved rectangle. I find the bahaviour somewhat ...
1
vote
1answer
529 views

d3 map rendering sideways

I have a simple d3 map displaying data from Canada in topojson format, but the entire map is rendering sideways. I have been playing with the rotation parameters but I can't seem to get it just right....
3
votes
1answer
481 views

How to Merge polygons while zooming out using leaflet?

I have created a map using leaflet, with polygons. Each polygon has its proper color(style) based on the number of inhabitants. please see the following example: Map I want to merge polygons as I ...
2
votes
1answer
178 views

Tangram YAML, use external function?

I would like to use some functions from D3 in my Tangram scene.yaml, but I'm not finding anything about it in the documentation. I've tried referencing D3 in the YAML, like so: layers: give: ...
2
votes
0answers
161 views

Choropleth map in html

I am making a choropleth map of population estimate by counties in United States. I am almost done but the problem is a few counties have population count in seven figures and they are the ones that ...
3
votes
1answer
578 views

Esri Cedar.js (based on D3.js)

Does anyone have experience with Esri's js charting library called cedar.js? It is apparently based on D3. I may be using it for work, but wondering if there are any pitfalls I should know about vs ...
1
vote
0answers
183 views

GeoJSON or TopoJSON outline of Milky Way [closed]

I'm looking for a GeoJSON or TopoJSON file with the Milky Way outline on the Sky sphere, for an astronomical almanac web application I'm building with the D3js JavaScript library. I have searched in ...
2
votes
0answers
8k views

“Map container not found”error with dc.js charts

I am trying to show marker cluster on dc.js charts ,I have around 30,346 data in json file i an stuck with one error map container not found <script> var map = L.map( 'map', { center: [20....
4
votes
1answer
967 views

GeoJSON maps created with D3 appear flipped/inverted

I am learning how to convert ESRI shapefiles to GeoJSON and then work with it in D3. I am following Mike Bostock's tutorial on Medium (https://medium.com/@mbostock/command-line-cartography-part-1-...
1
vote
0answers
296 views

Reading topojson file in d3.js problem

The topojson file with my code shows only one propriety with one path,my topojson file looks like the sample . what I am doing wrong ? I dont know if the problem with the topojson or the code as this ...
2
votes
1answer
5k views

How to set the icon for a Leaflet marker based on a variable

I'm just beginning to learn coding in d3 and leaflet, i have some code that i'm experimenting with and facing some problems with setting the icon. I wanted to change the leaflet icon depends on the ...
4
votes
1answer
1k views

Converting EPSG to D3.js

Given an EPSG projection (say, this Alabama one: http://spatialreference.org/ref/epsg/26729/) How can you take the given WGS84 projection bounds in such a way that you can use them in a D3.js ...
8
votes
3answers
824 views

Remove outlying territories/islands from Europe map

Using a shapefile from Natural earth, I am trying create a map of Europe with d3-geo’s new command-line interface. The following: shp2json -n ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp \ | ...
3
votes
1answer
496 views

Drawing GeoJson polygon in arbitrary coordinate system

I have a GeoJson polygon I am trying to draw in a 3d scene using d3 and three.js I have done this before when the polygon was represented in lat, lng coordinates, but in my case the coordinate system ...
0
votes
1answer
374 views

How to split Indian states and provinces from world states and provinces shapefile?

I am following Mike Bostock's D3 Lets make a map to create GeoJSON for states and provinces of a country. I got a shapefile for states and provinces from Natural Earth. I am trying to extract info for ...
3
votes
1answer
663 views

Which D3 microlibraries are required to load TopoJSON/GeoJSON files and translate into path definitions?

D3 v4 is modular, based on around 30 "microlibraries", intended to allow discrete functions to be broken out and used on their own. I'm trying to assemble a minimal set of D3 microlibraries to do the ...
2
votes
1answer
2k views

DC.js - barChart not filtered on click of geoChoroplethChart

I have a choropleth map of counties, and a bar chart showing population of each county on the map. When I click on the bar chart the map is filtered and redrawn to show the selected bar, but when I ...
0
votes
1answer
2k views

TopoJSON rendering issues using D3

I have rendered the world map using world-110m topojson. I directly used the code provided by Jakob on D3 mapping tutorial - http://www.digital-geography.com/d3-js-mapping-tutorial-1-set-initial-...
0
votes
0answers
206 views

Using ordnance survey data to make a D3 map?

I would like to display a map of the UK Westminster Parliamentary Constituencies in D3 with a width of 980px. I have downloaded and extracted the ordnance survey ESRI shapefiles from here: https://...
1
vote
2answers
670 views

D3 can't render GeoJson file (Simple structure in Montreal, Canada) created in QGIS

I am attempting to render SVG and attach it to a div with id="map". I can do this successfully with GeoJson which I acquired from this tutorial: http://maptimeboston.github.io/d3-maptime/#/1 Excerpt: ...