Comments (10)
It's some sort of error in the mercator projection- try using something like equirectangular or winkel3, and the map looks a little more normal.
from vega.
@wrobstory thx.
I tried, it's better than mercator, but it seems there is still something wrong:
When I don't hover over on the map it is:
Then when I hover over:
The opacity of the countries should become 0.5 but not. and there is the blue background and opacity of it turns 0.5. (PS: I think the background of it should be transparent)
And the winkel3 project has the same problem.
from vega.
I had the same problem with Mercator.
@tony612, there is probably some error in the geojson geometries. I can replicate it if i use yours. When i made my own geojson by exporting the "Natural Earth 110n countries" shapefile with ogr2ogr it works as expected. In the picture i'm hovering China, all geometries seem to work fine.
from vega.
I used this data, global_world to show the map, it shows normally. I think there is something wrong with my data. :)
But the mercator has not been fixed.
Has someone tried to fix it?
from vega.
The first error is because Vega presumably inherits D3’s default projection, d3.geo.albersUsa which as you might guess is U.S.-specific. (It’s a composite projection for the 48 contiguous United States, Alaska, Hawaii and Puerto Rico.) You’ll need to specify a different projection for a world map; choose one of the many other available projections.
The other error looks like a problem with winding order in your GeoJSON file, where the polygons are not in clockwise order. I’m not sure if Vega supports TopoJSON yet, but I highly recommend it as you can get much smaller data files (as well as the useful applications of topology). Here’s an example:
from vega.
@mbostock Thanks. I have tried to specify the projection as 'mercator', but it doesn't work well. Maybe there's something wrong as @wrobstory said.
I don't know if Vega support TopoJSON, this wiki only mentions the geoJSON
from vega.
As @mbostock points out above, it appears that the GeoJSON file used above has an error in it, which should explain the undesirable behavior.
In addition, commit c77bd25 fixes Vega's geopath to use mercator as the default (as stated in the spec documentation). Thanks for catching the bug! Also, Vega largely inherits D3's extensive geographic mapping facilities. TopoJSON support has not been tested, but we will do so soon.
from vega.
@jheer Is there something wrong with the GeoJSON file in the Vega's live editor?
In this editor, http://trifacta.github.io/vega/editor/index.html?spec=map, If you change the projection to mercator, you can see the same bug.
from vega.
The problem you are seeing is an albersUsa projection being used by accident. This was fixed in my earlier commit. However, the fix has not been posted to the live website yet. If you run the Vega editor locally using the most recent version in the repo, you'll see that geopath with mercator projection now works correctly.
from vega.
@jheer Thanks, it works normally. It's my mistake :)
from vega.
Related Issues (20)
- textPath
- "Extent" property for Regression does not modify the regression extent and nullifies the regression. HOT 3
- Proposal for new `sumnull` aggregation HOT 4
- Broken 'View in Online Vega Editor' link in an example HOT 1
- An issue with a data source in Vega example HOT 3
- CanvasRenderer and SVGRenderer do not give the same output when given a scaleFactor HOT 6
- TypeError when rendering a vega scene using SVGRenderer HOT 1
- Vega lite - Cannot use datum expr in scale padding
- interactively sorted data table is no longer sorted in line chart HOT 1
- Add a function for Base64 encoding to the expressions
- Should aggregate_params be aggregateParams HOT 5
- [Accessibility] Device Dependent handlers are used. Tooltips are not accessible with keyboard. HOT 1
- [Accessibility] Tooltip content is not accessible to screen readers. HOT 1
- [Accessibility] The content in the tooltip is not hoverable. HOT 4
- Numeric Instability During Linear Regression With Large x-values
- [Accessibility] Overlapping Legends when text spacing is applied as per WCAG 2.1 Text Spacing(Level AA) guidelines HOT 2
- Mobile webview taps on the chart doesn't display tooltips properly since vega version 5.26.0 HOT 2
- vega-lite-api & nodejs-polars HOT 6
- In Editor, should be possible to see data and signals from inner group elements. HOT 2
- Align legends to the left of the charts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vega.