From ec0bfe645d24e6817f3da3d702b210ef36236906 Mon Sep 17 00:00:00 2001 From: trafficonese <35805180+trafficonese@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:42:31 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20traffico?= =?UTF-8?q?nese/leaflet.extras2@b3f2b8660734991bdd88459a590356633e9c70c9?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/index.html | 1 + dev/news/index.html | 3 + dev/pkgdown.yml | 2 +- dev/reference/addClusterCharts.html | 329 +++++++++ dev/reference/addContextmenu.html | 4 +- dev/reference/addEasyprint.html | 4 +- dev/reference/addGIBS.html | 4 +- dev/reference/addHexbin.html | 4 +- dev/reference/addHistory.html | 4 +- dev/reference/addMapkeyMarkers.html | 4 +- dev/reference/addSidebyside.html | 4 +- dev/reference/addSpinner.html | 4 +- dev/reference/addTimeslider.html | 1 - dev/reference/addWMS.html | 4 +- dev/reference/clusterchartOptions.html | 158 +++++ dev/reference/historyOptions.html | 4 +- dev/reference/index.html | 12 + .../MIT-LICENCE.txt | 20 + .../MarkerCluster.Default.css | 60 ++ .../MarkerCluster.css | 14 + .../leaflet.markercluster.freezable.js | 6 + .../leaflet.markercluster.js | 7 + .../leaflet.markercluster.layersupport.js | 6 + .../leaflet-markercluster-1.0.5/package.json | 22 + .../libs/lfx-clustercharts-1.0.0/d3.v3.min.js | 5 + .../lfx-clustercharts-bindings.js | 660 ++++++++++++++++++ .../lfx-clustercharts.css | 50 ++ .../lfx-clustercharts-css-1.0.0/d3.v3.min.js | 5 + .../lfx-clustercharts-bindings.js | 660 ++++++++++++++++++ .../lfx-clustercharts.css | 50 ++ dev/sitemap.xml | 2 + 31 files changed, 2091 insertions(+), 22 deletions(-) create mode 100644 dev/reference/addClusterCharts.html create mode 100644 dev/reference/clusterchartOptions.html create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/MIT-LICENCE.txt create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/MarkerCluster.Default.css create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/MarkerCluster.css create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/leaflet.markercluster.freezable.js create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/leaflet.markercluster.js create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/leaflet.markercluster.layersupport.js create mode 100644 dev/reference/libs/leaflet-markercluster-1.0.5/package.json create mode 100644 dev/reference/libs/lfx-clustercharts-1.0.0/d3.v3.min.js create mode 100644 dev/reference/libs/lfx-clustercharts-1.0.0/lfx-clustercharts-bindings.js create mode 100644 dev/reference/libs/lfx-clustercharts-1.0.0/lfx-clustercharts.css create mode 100644 dev/reference/libs/lfx-clustercharts-css-1.0.0/d3.v3.min.js create mode 100644 dev/reference/libs/lfx-clustercharts-css-1.0.0/lfx-clustercharts-bindings.js create mode 100644 dev/reference/libs/lfx-clustercharts-css-1.0.0/lfx-clustercharts.css diff --git a/dev/index.html b/dev/index.html index aebcc1b0..cbc934c7 100644 --- a/dev/index.html +++ b/dev/index.html @@ -109,6 +109,7 @@

Integrated PluginsTangram
  • Velocity
  • WMS
  • +
  • ClusterCharts
  • diff --git a/dev/news/index.html b/dev/news/index.html index 0d05a035..e814391c 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -52,6 +52,9 @@
    diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 73f8b056..bc715d07 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -2,4 +2,4 @@ pandoc: 3.1.11 pkgdown: 2.1.0 pkgdown_sha: ~ articles: {} -last_built: 2024-08-06T11:09Z +last_built: 2024-09-01T12:42Z diff --git a/dev/reference/addClusterCharts.html b/dev/reference/addClusterCharts.html new file mode 100644 index 00000000..adfbf9a3 --- /dev/null +++ b/dev/reference/addClusterCharts.html @@ -0,0 +1,329 @@ + +addClusterCharts — addClusterCharts • leaflet.extras2 + + +
    +
    + + + +
    +
    + + +
    +

    Clusters markers on a Leaflet map and visualizes them using +customizable charts, such as pie or bar charts, showing counts by category. +When using the "custom" type, a pie chart is rendered with aggregated data, +employing methods like sum, min, max, mean, or median.

    +
    + +
    +
    addClusterCharts(
    +  map,
    +  layerId = NULL,
    +  group = NULL,
    +  type = c("pie", "bar", "horizontal", "custom"),
    +  aggregation = c("sum", "min", "max", "mean", "median"),
    +  valueField = NULL,
    +  options = clusterchartOptions(),
    +  icon = NULL,
    +  html = NULL,
    +  popup = NULL,
    +  popupOptions = NULL,
    +  label = NULL,
    +  labelOptions = NULL,
    +  clusterOptions = NULL,
    +  clusterId = NULL,
    +  categoryField,
    +  categoryMap,
    +  popupFields = NULL,
    +  popupLabels = NULL,
    +  markerOptions = NULL,
    +  legendOptions = list(title = "", position = "topright"),
    +  data = getMapData(map)
    +)
    +
    + +
    +

    Arguments

    + + +
    map
    +

    a map widget object created from leaflet()

    + + +
    layerId
    +

    the layer id

    + + +
    group
    +

    the name of the group the newly created layers should belong to +(for clearGroup and addLayersControl purposes). +Human-friendly group names are permitted–they need not be short, +identifier-style names. Any number of layers and even different types of +layers (e.g. markers and polygons) can share the same group name.

    + + +
    type
    +

    The type of chart to use for clusters: "pie", "bar", "horizontal", or "custom".

    + + +
    aggregation
    +

    Aggregation method for "custom" charts (e.g., sum, min, max, mean, median).

    + + +
    valueField
    +

    Column name with values to aggregate for "custom" charts.

    + + +
    options
    +

    Additional options for cluster charts (see clusterchartOptions).

    + + +
    icon
    +

    An icon or set of icons to include, created with makeIcon or iconList.

    + + +
    html
    +

    The column name containing the HTML content to include in the markers.

    + + +
    popup
    +

    The column name used to retrieve feature properties for the popup.

    + + +
    popupOptions
    +

    A Vector of popupOptions to provide popups

    + + +
    label
    +

    a character vector of the HTML content for the labels

    + + +
    labelOptions
    +

    A Vector of labelOptions to provide label +options for each label. Default NULL

    + + +
    clusterOptions
    +

    if not NULL, markers will be clustered using +Leaflet.markercluster; + you can use markerClusterOptions() to specify marker cluster +options

    + + +
    clusterId
    +

    the id for the marker cluster layer

    + + +
    categoryField
    +

    Column name for categorizing charts.

    + + +
    categoryMap
    +

    A data.frame mapping categories to chart properties (e.g., label, color, icons, stroke).

    + + +
    popupFields
    +

    A string or vector of strings indicating the column names to include in popups.

    + + +
    popupLabels
    +

    A string or vector of strings indicating the labels for the popup fields.

    + + +
    markerOptions
    +

    Additional options for markers (see markerOptions::markerOptions()).

    + + +
    legendOptions
    +

    A list of options for the legend, including the title and position.

    + + +
    data
    +

    the data object from which the argument values are derived; by +default, it is the data object provided to leaflet() +initially, but can be overridden

    + +
    +
    +

    Details

    +

    The `clusterCharts` use Leaflet's `L.DivIcon`, allowing you to fully customize +the styling of individual markers and clusters using CSS. Each individual marker +within a cluster is assigned the CSS class `clustermarker`, while the entire +cluster is assigned the class `clustermarker-cluster`. You can modify the appearance +of these elements by targeting these classes in your custom CSS.

    +
    +
    +

    See also

    +

    Other clusterCharts: +clusterchartOptions()

    +
    + +
    +

    Examples

    +
    # Example usage:
    +library(sf)
    +#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
    +library(leaflet)
    +library(leaflet.extras2)
    +
    +data <- sf::st_as_sf(breweries91)
    +categories <- c("Schwer", "Mäßig", "Leicht", "kein Schaden")
    +data$category <- sample(categories, size = nrow(data), replace = TRUE)
    +
    +## Pie Chart
    +leaflet() %>%
    +  addProviderTiles("CartoDB.Positron") %>%
    +  leaflet::addLayersControl(overlayGroups = "clustermarkers") %>%
    +  addClusterCharts(data = data
    +                   , categoryField = "category"
    +                   , categoryMap = data.frame(labels = categories,
    +                                              colors  = c("#F88", "#FA0", "#FF3", "#BFB"),
    +                                              strokes = "gray")
    +                   , group = "clustermarkers"
    +                   , popupFields = c("brewery", "address", "zipcode", "category")
    +                   , popupLabels = c("Brauerei", "Adresse", "PLZ", "Art")
    +                   , label = "brewery"
    +  )
    +
    + +## Bar Chart +leaflet() %>% + addProviderTiles("CartoDB.Positron") %>% + leaflet::addLayersControl(overlayGroups = "clustermarkers") %>% + addClusterCharts(data = data + , type = "bar" + , categoryField = "category" + , categoryMap = data.frame(labels = categories, + colors = c("#F88", "#FA0", "#FF3", "#BFB"), + strokes = "gray") + , group = "clustermarkers" + , popupFields = c("brewery", "address", "zipcode", "category") + , popupLabels = c("Brauerei", "Adresse", "PLZ", "Art") + , label = "brewery") +
    + +## Custom Pie Chart with "mean" aggregation on column "value" +data <- sf::st_as_sf(breweries91) +categories <- c("Schwer", "Mäßig", "Leicht", "kein Schaden") +data$category <- sample(categories, size = nrow(data), replace = TRUE) +data$value <- round(runif(nrow(data), 0, 100), 0) + +leaflet() %>% + addProviderTiles("CartoDB.Positron") %>% + leaflet::addLayersControl(overlayGroups = "clustermarkers") %>% + addClusterCharts(data = data + , type = "custom" + , valueField = "value" + , aggregation = "mean" + , categoryField = "category" + , categoryMap = data.frame(labels = categories, + colors = c("#F88", "#FA0", "#FF3", "#BFB"), + strokes = "gray") + , options = clusterchartOptions(rmax=50, digits=0, innerRadius = 20) + , group = "clustermarkers" + , popupFields = c("brewery", "address", "zipcode", "category","value") + , popupLabels = c("Brauerei", "Adresse", "PLZ", "Art", "Value") + , label = "brewery" + ) +
    + +## For Shiny examples, please run: +# runApp(system.file("examples/clusterCharts_app.R", package = "leaflet.extras2")) +# runApp(system.file("examples/clustercharts_sum.R", package = "leaflet.extras2")) +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.0.

    +
    + +
    + + + + + + + + diff --git a/dev/reference/addContextmenu.html b/dev/reference/addContextmenu.html index 089c2196..b1afa674 100644 --- a/dev/reference/addContextmenu.html +++ b/dev/reference/addContextmenu.html @@ -144,8 +144,8 @@

    Examples

    index = 1) ) )) -
    - +
    +
    diff --git a/dev/reference/addEasyprint.html b/dev/reference/addEasyprint.html index fbf4e11f..e0a80be9 100644 --- a/dev/reference/addEasyprint.html +++ b/dev/reference/addEasyprint.html @@ -93,8 +93,8 @@

    Examples

    title = 'Print map', position = 'bottomleft', exportOnly = TRUE)) -
    - +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    +