Skip to content

[feature-idea]: zcol count parameter #495

@sonicseamus

Description

@sonicseamus

I often have datasets where I would like to visualize the number of occurrences of my zcol variable ("name" in this example), e.g.

Geometry name
(1, 1) "a"
(1, 2) "b"
(1, 3) "c"
(1, 4) "d"
(1, 3) "c"
(1, 1) "a"

and what I want displayed by mapview is really the summarized dataframe:

Geometry name count
(1, 1) "a" 2
(1, 2) "b" 1
(1, 3) "c" 2
(1, 4) "d" 1

where the new "count" column is the one visualized on a scale with zcol. However, it should still display the "name" column when I mouse over the data points for ease of identification.

I could accomplish something close to this by using mapview(df |> dplyr::count(name), zcol = "n", label = "name"), but it might be more intuitive if it could be implemented as a one-step function within the mapview call, perhaps something like mapview(df, zcol = "name", count = TRUE).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions