Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joewdavies committed Jan 23, 2025
1 parent debe33f commit 192eeaa
Show file tree
Hide file tree
Showing 20 changed files with 393 additions and 1,313 deletions.
1,648 changes: 364 additions & 1,284 deletions examples/CCM/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="https://unpkg.com/eurostat-map"></script>
<script>
eurostatmap
.map('ch')
.map('choropleth')
.width(800)
.title('Population density in Europe')
.subtitle('2021')
Expand Down
2 changes: 1 addition & 1 deletion examples/population-change.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script>
let height = window.innerHeight
let m = eurostatmap
.map('ch')
.map('choropleth')
.width(800)
.title('Population change')
.subtitle('Change per 1 000 persons, 2022')
Expand Down
2 changes: 1 addition & 1 deletion examples/population-density.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="https://unpkg.com/eurostat-map"></script>
<script>
eurostatmap
.map('ch')
.map('choropleth')
.title('Population density in Europe')
.width(800)
.subtitle('2021')
Expand Down
2 changes: 1 addition & 1 deletion examples/population-dot-density.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="https://unpkg.com/eurostat-map"></script>
<script>
eurostatmap
.map('ch')
.map('choropleth')
.title('Population density in Europe')
.stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²', filters: { TIME: '2021' } })
.titleFill('#444')
Expand Down
2 changes: 1 addition & 1 deletion examples/small_multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 style="font-family: sans-serif">20 years of GDP change in Europe</h1>
for (let year = 2021; year >= 2000; year--) {
for (let q = 1; q <= 4; q++) {
eurostatmap
.map('ch')
.map('choropleth')
.svgId('map_' + year + '_Q' + q)
.title(year + ' ' + 'Q' + q)
.titleFontSize(18)
Expand Down
2 changes: 1 addition & 1 deletion examples/world.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
SX: 45,
}
const map = eurostatmap
.map('ch')
.map('choropleth')
.geo('WORLD')
.width(Math.min(window.innerHeight, window.innerWidth))
.nutsLevel('mixed')
Expand Down
4 changes: 2 additions & 2 deletions test/IMAGE/dot_density.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -10,7 +10,7 @@
<script src="../../build/eurostatmap.js"></script>
<script>
const map = eurostatmap
.map('ch')
.map('choropleth')
.filtersDefinitionFunction(
eurostatmap.getFillPatternDefinitionFun({
patternSize: 5,
Expand Down
2 changes: 1 addition & 1 deletion test/jest/choropleth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('choropleth with threshold scale', async () => {
// these will be executed within test.html, that was loaded before
//builds test map in test.html
eurostatmap
.map('ch')
.map('choropleth')
.svgId('testMap')
.svgId('mapCH')
.title('Population in Europe')
Expand Down
2 changes: 1 addition & 1 deletion test/jest/export.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('exporting map as SVG', async () => {
// evaluate will run the function in the page context
await page.evaluate((_) => {
let myMap = eurostatmap
.map('ch')
.map('choropleth')
.title('Population in Europe')
.width(600)
.scale('20M')
Expand Down
2 changes: 1 addition & 1 deletion test/jest/legend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('separated legend', async () => {
// these will be executed within test.html, that was loaded before
//builds test map in test.html
eurostatmap
.map('ch')
.map('choropleth')
.width(500)
.scale('60M')
.stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' })
Expand Down
2 changes: 1 addition & 1 deletion test/jest/progstat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('programmatically defined statistics', async () => {
await page.evaluate((_) => {
// these will be executed within test.html, that was loaded before.
//builds map in test.html
const map = eurostatmap.map('ch')
const map = eurostatmap.map('choropleth')
map.nutsLevel(0)

map.statData()
Expand Down
4 changes: 2 additions & 2 deletions test/map-types/patterned-choropleth/test_dd.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -10,7 +10,7 @@
<script src="../../../build/eurostatmap.js"></script>
<script>
const map = eurostatmap
.map('ch')
.map('choropleth')
.title('Dot density')
// define dot density pattern
.filtersDefinitionFunction(
Expand Down
2 changes: 1 addition & 1 deletion test/test_deprecated.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="../build/eurostatmap.js"></script>
<script>
const map = eurostatmap
.map('ch')
.map('choropleth')
.svgId('map1')
.zoomExtent([1, 20])
.title('Population Density in Europe')
Expand Down
10 changes: 5 additions & 5 deletions test/test_insets.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -15,17 +15,17 @@
<svg id="map5"></svg>
<script src="../build/eurostatmap.js"></script>
<script>
// eurostatmap.map('ch').svgId('map1').width(400).insets('default').insetBoxWidth(100).build()
// eurostatmap.map('choropleth').svgId('map1').width(400).insets('default').insetBoxWidth(100).build()
// eurostatmap
// .map('ch')
// .map('choropleth')
// .svgId('map2')
// .width(400)
// .insets({ geo: 'GF', height: 250 })
// .insetBoxPosition([180, 0])
// .insetZoomExtent([0, 99999])
// .build()
// eurostatmap
// .map('ch')
// .map('choropleth')
// .svgId('map3')
// .width(400)
// .geo('LI')
Expand All @@ -37,7 +37,7 @@
// .insetBoxPosition([10, 10])
// .build()
// eurostatmap
// .map('ch')
// .map('choropleth')
// .svgId('map4')
// .width(250)
// .geo('LI')
Expand Down
4 changes: 2 additions & 2 deletions test/test_legend_out.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -12,7 +12,7 @@
<script src="../build/eurostatmap.js"></script>
<script>
eurostatmap
.map('ch')
.map('choropleth')
.width(500)
.scale('60M')
.stat({ eurostatDatasetCode: 'demo_r_d3dens', unitText: 'people/km²' })
Expand Down
4 changes: 2 additions & 2 deletions test/test_mix_NUTS.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -13,7 +13,7 @@
let mapWidth = 638
let mapHeight = 608
let map = eurostatmap
.map('ch')
.map('choropleth')
.pixelSize(7400)
//.scale("03M")
.zoomExtent([1, 5])
Expand Down
4 changes: 2 additions & 2 deletions test/test_progstat.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -9,7 +9,7 @@
<svg id="map"></svg>
<script src="../build/eurostatmap.js"></script>
<script>
const map = eurostatmap.map('ch')
const map = eurostatmap.map('choropleth')
map.nutsLevel(0)
map.legend({ x: 600, y: 20 })

Expand Down
2 changes: 1 addition & 1 deletion test/test_scalebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="../build/eurostatmap.js"></script>
<script>
const map = eurostatmap
.map('ch')
.map('choropleth')
.showScalebar(true)
.scalebarTickHeight(10)
.scalebarSegmentHeight(7)
Expand Down
4 changes: 2 additions & 2 deletions test/test_tooltip.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -10,7 +10,7 @@
<script src="../build/eurostatmap.js"></script>
<script>
const map = eurostatmap
.map('ch')
.map('choropleth')
.title('Population in Europe')
.insets('default')
.scale('60M')
Expand Down

0 comments on commit 192eeaa

Please sign in to comment.