d3plus / d3plus-geomap Goto Github PK
View Code? Open in Web Editor NEWA reusable geo map built on D3 and Topojson
Home Page: https://d3plus.org
License: MIT License
A reusable geo map built on D3 and Topojson
Home Page: https://d3plus.org
License: MIT License
I should be able to change the data provided to .data( )
and the associated variable passed to .colorScale( )
to update the map.
Currently, certain combinations will make the map empty.
http://jsfiddle.net/14L2qn89/17/
Hi all,
I noticed that in many pages using this library, default CARTO tiles are used, which are based on OpenStreetMap data, without giving proper attribution. Is it possible to have an easy way to add attribution within this library?
Thanks,
dependent on this issue: d3plus/d3plus-shape#78
ariaLabel
should be based on the following formulas:
${drawLabel}, ${colorScale value}.
${drawLabel}, ${radius value}.
Users should be able to provide either a static color as a String, or an accessor function that is provided the current data point.
This new accessor function should be used on this line as the fallback color in the "fill" function: https://github.com/d3plus/d3plus-geomap/blob/master/src/Geomap.js#L82
Hi,
I am having issues with Internet Explorer (e.g. IE11) and probably all others post IE 8 with the map not rendering and only "Loading Visualization Powered by D3plus" displaying. The debugged error is " Object doesn't support property or method 'includes' File: d3plus-geomap.v0.4.full.min.js, Line: 7, Column: 105644". Having a quick look through the JS, there are a significant number if includes that are involved rather than the odd one and IE doesn't understand includes
The map should display in IE like it does in Chrome, FF or any other real browser
"Loading Visualization Powered by D3plus" and the map does not load
IE11 in a SOE environment as an example however it appears to affect all IE later environments
When using the colorScale method, and there is only 1 data point available, the scale gets rendered with no values and the topojson is rendered as black.
The color scale should not appear, and the topojson should be colored the max color in the scale.
https://jsfiddle.net/2zb6retc/9/
Map renders, but with only 1 place (colored as either the highest or lowest value in the scale)
Map renders black and gets stuck saying "Loading visualization / powered by d3plus"
Geomap.js:76 Uncaught TypeError: this$1._colorScaleClass._colorScale is not a function
at Geomap.fill (Geomap.js:76)
at eval (configPrep.js:23)
at Function.styleLogic (Shape.js:208)
at SVGPathElement.eval (attr.js:30)
at Selection.__webpack_exports__.a [as each] (each.js:5)
at Selection.__webpack_exports__.a [as attr] (attr.js:54)
at Path._applyStyle (Shape.js:212)
at Selection.__webpack_exports__.a [as call] (call.js:4)
at Path.render (Path.js:61)
at Geomap._draw (Geomap.js:364)
I tried both the uniform and jenks scales.
The legend labels for some maps using jenks breaks overlap with each other which can make the legend hard to read.
To have labels avoid overlapping. Either,
just some ideas
OSX / Chrome
.shapeConfig({
label: d => d.id,
labelBounds: (d, i, s) => {
const poly = d3plus.largestRect(s.points);
return poly ? {
x: poly.cx - poly.width / 2,
y: poly.cy - poly.height / 2,
width: poly.width,
height: poly.height
} : null;
}
})
When changing the following methods, the projection bounds should be re-calculated:
fitObject
fitFilter
fitKey
topojson
topojsonFilter
topojsonKey
Currently, the first projection bound calculated is maintained.
Expectation: the map will load, and there will be one value colored in accordance with the maximal value of the specified color scale.
The map shape is filled in black (not part of color scale) and the "powered by d3plus" text doesn't disappear.
When resizing a visualization, the coordinate points and underlying tiles should update to fit the new screen size.
The coordinate points seem to be updating, but the tile projection is not.
http://jsfiddle.net/srbuy7ez/4/
d3plus-legend.js:161 Uncaught TypeError: Cannot read property 'length' of undefined
at fillMatrices (d3plus-legend.js:161)
at ckmeans (d3plus-legend.js:237)
at ColorScale.render (d3plus-legend.js:354)
at Geomap.drawColorScale (d3plus-viz.js:150)
at Geomap._draw (d3plus-viz.js:875)
at Geomap._draw (d3plus-geomap.js:222)
at Queue.eval [as _call] (d3plus-viz.js:995)
at maybeNotify (queue.js:115)
at Queue.awaitAll (queue.js:46)
at Geomap.render (d3plus-viz.js:994)
Logic was implemented manually in Data USA, and the code exists in d3plus but is just commented out.
Should be fairly straightforward, looks like they support standard tile URLs: http://maps.stamen.com/#terrain/12/37.7706/-122.3782
Would probably just need a live example of changing the map tile URL. Maybe even supplying shortcuts for different vendors, ie. .tiles("stamen")
Seems to be a bug in resetting the colorScale back to nothing, here's my config:
shapeConfig: {
Path: {
fill: d => colorScale(d[val])
}
},
colorScale: false
};
And here's the console error:
ckmeans.js:149 Uncaught TypeError: Cannot read property 'length' of undefined
at fillMatrices (ckmeans.js:149)
at __webpack_exports__.a (ckmeans.js:225)
at ColorScale.render (ColorScale.js:118)
at Geomap.__webpack_exports__.a (_drawColorScale.js:50)
at Geomap._draw (Viz.js:336)
at Geomap._draw (Geomap.js:159)
at Queue.eval [as _call] (Viz.js:486)
at maybeNotify (queue.js:115)
at eval (queue.js:86)
at eval (load.js:50)
Feature request: add an option to only draw boundaries for areas with data. This could be helpful when visualizing a map in conjunction with dynamic API calls for variables that may only cover certain tracts for example, and instead of showing many empty tracts it could be nice to simply hide those without data.
I'm using the geomap to display a choropleth, and it's working great. Since the choropleth overlays the geography below, it's difficult to orient where you are on the map. I'd love to be able to put a marker on the map that represents a point of interest, and that marker should overlay the choropleth. I tried doing same w/ points on a map, but it seems that points and choropleth are mutually exclusive -- you can have one or the other.
Bonus: support arbitrary marker images.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.