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
0 answers
33 views

Move cells across cell groups in a grid

Let's say there are a bunch of cell groups in a matrix/grid of n number of cells. What's the best way to move cells across cell groups? The use case: I want to convert Grid 1 to Grid 2. Notice that ...
user avatar
  • 11
0 votes
0 answers
16 views

D3.js globe view data visualization

I am using D3.js globe view as in the code penhttps://codepen.io/EleftheriaBatsou/pen/VQxdVY?editors=1000 India map that is in the globe view widget is not same as the one while verifying the globe in ...
user avatar
0 votes
0 answers
168 views

Drawing a Custom Map Projection in D3 using Observable

I am trying to create a custom map projections in D3 using Observable, following the approach given in the d3-geo Docs. Essentially, you pass a function that takes in (lambda, phi) and returns [x, y]. ...
user avatar
  • 348
0 votes
1 answer
83 views

Stream GPS coordinates using D3 and Mapbox

I’m currently working on a project to stream GeoJSON data using D3 and Mapbox. But, I wasn’t able to plot my data based on their types. Basically, I have three different types of GPS data, when using ...
user avatar
2 votes
1 answer
213 views

Why d3.js works only with GeoJSON violating right-hand rule?

Why d3.js works only with GeoJSON that is left-hand formatted? { "type": "FeatureCollection", "features": [ { "type": "Feature", ...
user avatar
0 votes
1 answer
181 views

How to programmatically create a bivariate choropleth in d3.js?

Question and Situation I'm using d3.js to visualize some data on a map. The user clicks on one checkbox and all path elements get filled according to a color-preset, which all works fine. Now what we ...
user avatar
  • 101
0 votes
1 answer
130 views

Smoothing isobar d3 js from GeoTIFF

I'm using d3.js to display isobars from GeoTIFF in Leaflet. The problem I would like to solve is the smoothing of those isolines. Here is my code: var xhr = new XMLHttpRequest(); xhr.open('GET', `....
user avatar
2 votes
2 answers
693 views

Putting different id in different paths on my Leaflet map

I have many polygons to display on map like this: L.geoJSON(polygon, { style: function (feature) { return { stroke: true, fillColor: feature.color, ...
user avatar
1 vote
1 answer
561 views

Changing style of only selected polygons in L.geoJSON layer?

So, I'm going to show a lot of polygons in my Leaflet map but I need an id for each polygon, the URL comes in a path like this. In fact I wouldn't even need an id, if I could somehow get some ...
user avatar
1 vote
1 answer
723 views

Transforming custom coordinates to pixel in vector layer in OpenLayers 6

I have a XYZ layer for tiles(generated from an 1065 * 950 Image using gdal2tiles), and a vector layer for features, I want to use my own pixel transformation to set the coordinates of the features. ...
user avatar
  • 11
1 vote
1 answer
1k 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 ...
user avatar
  • 1,305
1 vote
1 answer
136 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, ...
user avatar
  • 173
0 votes
0 answers
124 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"; /**********************************...
user avatar
1 vote
0 answers
616 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"); //...
user avatar
  • 111
1 vote
0 answers
361 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}...
user avatar
1 vote
1 answer
421 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 ...
user avatar
1 vote
0 answers
287 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: "...
user avatar
  • 123
3 votes
1 answer
1k 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 ...
user avatar
  • 9,216
1 vote
0 answers
61 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 ...
user avatar
  • 1,150
1 vote
1 answer
727 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 ...
user avatar
1 vote
0 answers
348 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 ...
user avatar
  • 89
5 votes
2 answers
127 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 ...
user avatar
1 vote
0 answers
994 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">...
user avatar
0 votes
1 answer
212 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 ...
user avatar
  • 228
0 votes
0 answers
505 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 ...
user avatar
0 votes
2 answers
240 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 ...
user avatar
  • 1
1 vote
2 answers
322 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 ...
user avatar
0 votes
1 answer
506 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 ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
2 votes
0 answers
453 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 ...
user avatar
2 votes
1 answer
901 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 ...
user avatar
2 votes
0 answers
280 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 ...
user avatar
0 votes
1 answer
403 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 ...
user avatar
2 votes
2 answers
561 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 '...
user avatar
  • 121
0 votes
1 answer
702 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 ...
user avatar
  • 5,573
2 votes
1 answer
1k 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 ...
user avatar
  • 69
1 vote
0 answers
294 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 ...
user avatar
1 vote
0 answers
332 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 ...
user avatar
2 votes
1 answer
480 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 ...
user avatar
1 vote
0 answers
472 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 ...
user avatar
1 vote
1 answer
763 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....
user avatar
  • 3,246
3 votes
1 answer
736 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 ...
user avatar
  • 303
2 votes
1 answer
193 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: ...
user avatar
2 votes
0 answers
168 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 ...
user avatar
3 votes
1 answer
631 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 ...
user avatar
1 vote
0 answers
199 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 ...
user avatar
  • 11
2 votes
0 answers
10k 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....
user avatar
4 votes
1 answer
1k 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-...
user avatar
  • 191
1 vote
0 answers
346 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 ...
user avatar
  • 11
3 votes
1 answer
8k 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 ...
user avatar
  • 51