JuliaAcademy / DataScience

Data Science in Julia course for JuliaAcademy.com, taught by Huda Nassar
https://juliaacademy.com/p/julia-for-data-science
MIT License
488 stars 256 forks source link

[VegaLite Issue] Clustering Notebook #24

Closed shaksham95 closed 3 years ago

shaksham95 commented 3 years ago

While trying to plot the lat/long on a map using VegaLite, I am facing this weird issue.

If I use the following code:

@vlplot(width=500, height=300)
@vlplot(
        mark = {
                :geoshape,
                fill=:black,
                stroke=:white
        },
        data = {
                values=VV,
                format={
                        type=:topojson,
                        feature=:cb_2015_california_county_20m
                }
        },
        projection = {type=:albersUsa},
)+
@vlplot(
        :circle,
        data=houses_data,
        projection={type=:albersUsa},
        longitude="longitude:q",
        latitude="latitude:q",
        size={value=12},
        color="median_house_value:q"
)

then the plot is generated with a warning: WARN Layer's shared projection {"type":"albersUsa"} is overridden by a child projection {"type":"albersUsa"}.

However, if I do this minor change:

@vlplot(width=500, height=300) +
@vlplot(
        mark = {
                :geoshape,
                fill=:black,
                stroke=:white
                },
        data = {
                values=VV,
                format={
                        type=:topojson,
                        feature=:cb_2015_california_county_20m
                       }
               },
        projection = {type=:albersUsa},
)+
@vlplot(
        :circle,
        data=houses_data,
        projection={type=:albersUsa},
        longitude="longitude:q",
        latitude="latitude:q",
        size={value=12},
        color="cprice:n"
)

just adding a '+' after (height, width) specification, gives the following error:

image

I am not sure, why this is happening, Can anyone please help?

logankilpatrick commented 3 years ago

Hmm, odd, I just tested and things seem to work just fine. Let me know if this continues to be an issue.