From e946f6d3905899a88135fda28f6add63c71b80e8 Mon Sep 17 00:00:00 2001 From: Damiano Oldoni Date: Mon, 20 Nov 2023 16:00:59 +0100 Subject: [PATCH] Knit improved Rmd 20231026 --- src/20231026/2_visualize_data.html | 50 +++++++++++++++++------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/20231026/2_visualize_data.html b/src/20231026/2_visualize_data.html index 6812a73..106a530 100644 --- a/src/20231026/2_visualize_data.html +++ b/src/20231026/2_visualize_data.html @@ -12,7 +12,7 @@ - + Data visualization @@ -8183,7 +8183,9 @@ $input.parent().hide(); $x.show().trigger('show'); filter[0].selectize.focus(); }, input: function() { - if ($input.val() === '') filter[0].selectize.setValue([]); + var v1 = JSON.stringify(filter[0].selectize.getValue()), v2 = $input.val(); + if (v1 === '[]') v1 = ''; + if (v1 !== v2) filter[0].selectize.setValue(v2 === '' ? [] : JSON.parse(v2)); } }); var $input2 = $x.children('select'); @@ -9088,7 +9090,7 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v); + $(td).find('input').first().val(v).trigger('input'); searchColumn(i, v); }); table.draw(); @@ -9503,7 +9505,7 @@

Data visualization

Damiano Oldoni

you

-

2023-10-30

+

2023-11-20

@@ -9525,9 +9527,10 @@

1 Setup

Same holds true for catch_fl, the cleaned data as output of challenge 1. Again, notice that it is present in your local environment, but won’t be during the knitting process.

-

Read catch_fl containing the cleaned geese catch -data:

-
path_catch_file <- here("data", "20231026", "20231026_geese_counts_cleaned.txt")
+

Read catch_fl containing the cleaned geese catch data. +Notice that this file is not provided, but it’s written on disk in the +last section of 1_geese_read_data.Rmd:

+
path_catch_file <- here::here("data", "20231026", "20231026_geese_counts_cleaned.txt")
 catch_fl <- read_csv(path_catch_file, na = "")
@@ -9593,9 +9596,9 @@

3.2.1 Species "Nijlgans" )

-
-

3.2.2 Catches per per -year and species

+
+

3.2.2 Catches per year +and species

catch_species <-
   catch_fl %>%
   dplyr::filter(commonName %in% species) %>%
@@ -9715,8 +9718,8 @@ 

4 Dynamic maps

) ) map_catch_pr
-
- +
+

4.1 crosstalk

We show also what you can do using the crosstalk package. For @@ -9751,21 +9754,24 @@

4.1 crosstalk

-
- +
+
-
- +
+
-

Some limitations: 1. No polygons, only points at the moment 2. the -interaction doesn’t work with adding the clustering option in the -leaflet markers, e.g. using -addCircleMarkers(radius = 1, clusterOptions = markerClusterOptions()) -3. Because all data must be loaded into the browser, Crosstalk is not -appropriate for large data sets.

+

Some limitations:

+
    +
  1. No polygons, only points at the moment

  2. +
  3. The interaction doesn’t work with adding the clustering option in +the leaflet markers, e.g. using +addCircleMarkers(radius = 1, clusterOptions = markerClusterOptions())

  4. +
  5. Because all data must be loaded into the browser, crosstalk is +not appropriate for large data sets.

  6. +

Do you want more? Go to crosstalk homepage.