Compare commits
3 Commits
987-tutori
...
feature/le
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1170e9239 | ||
|
|
299477a717 | ||
|
|
5e72711629 |
@@ -7,21 +7,13 @@ import { Mermaid } from '@portaljs/core';
|
||||
// to handle import statements. Instead, you must include components in scope
|
||||
// here.
|
||||
const components = {
|
||||
Table: dynamic(() => import('@portaljs/components').then((mod) => mod.Table)),
|
||||
Catalog: dynamic(() =>
|
||||
import('@portaljs/components').then((mod) => mod.Catalog)
|
||||
),
|
||||
Table: dynamic(() => import('@portaljs/components').then(mod => mod.Table)),
|
||||
Catalog: dynamic(() => import('@portaljs/components').then(mod => mod.Catalog)),
|
||||
mermaid: Mermaid,
|
||||
Vega: dynamic(() => import('@portaljs/components').then((mod) => mod.Vega)),
|
||||
VegaLite: dynamic(() =>
|
||||
import('@portaljs/components').then((mod) => mod.VegaLite)
|
||||
),
|
||||
LineChart: dynamic(() =>
|
||||
import('@portaljs/components').then((mod) => mod.LineChart)
|
||||
),
|
||||
FlatUiTable: dynamic(() =>
|
||||
import('@portaljs/components').then((mod) => mod.FlatUiTable)
|
||||
),
|
||||
Vega: dynamic(() => import('@portaljs/components').then(mod => mod.Vega)),
|
||||
VegaLite: dynamic(() => import('@portaljs/components').then(mod => mod.VegaLite)),
|
||||
LineChart: dynamic(() => import('@portaljs/components').then(mod => mod.LineChart)),
|
||||
FlatUiTable: dynamic(() => import('@portaljs/components').then(mod => mod.FlatUiTable)),
|
||||
} as any;
|
||||
|
||||
export default function DRD({ source }: { source: any }) {
|
||||
|
||||
@@ -156,8 +156,8 @@ the key to a prosperous future.
|
||||
title: '',
|
||||
field: 'label',
|
||||
scale: {
|
||||
domain: ['Education'],
|
||||
range: ['#64b5f6'],
|
||||
domain: ["Education"],
|
||||
range: ['#64b5f6']
|
||||
},
|
||||
},
|
||||
tooltip: [
|
||||
@@ -189,3 +189,4 @@ Frankfurt is a city that's recognized the power of education, and it's using tha
|
||||
One can only hope that more cities follow suit.
|
||||
|
||||
[^1]: https://worldpopulationreview.com/world-cities/frankfurt-population
|
||||
|
||||
|
||||
311
examples/openspending/package-lock.json
generated
@@ -14,7 +14,7 @@
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@octokit/plugin-throttling": "^5.2.2",
|
||||
"@portaljs/ckan": "^0.0.2",
|
||||
"@portaljs/components": "0.1.12",
|
||||
"@portaljs/components": "^0.1.12",
|
||||
"@portaljs/core": "^1.0.5",
|
||||
"@portaljs/remark-callouts": "^1.0.5",
|
||||
"@portaljs/remark-embed": "^1.0.4",
|
||||
@@ -1971,40 +1971,6 @@
|
||||
"@lit-labs/ssr-dom-shim": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@mapbox/jsonlint-lines-primitives": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
|
||||
"integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@mapbox/mapbox-gl-style-spec": {
|
||||
"version": "13.28.0",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-style-spec/-/mapbox-gl-style-spec-13.28.0.tgz",
|
||||
"integrity": "sha512-B8xM7Fp1nh5kejfIl4SWeY0gtIeewbuRencqO3cJDrCHZpaPg7uY+V8abuR+esMeuOjRl5cLhVTP40v+1ywxbg==",
|
||||
"dependencies": {
|
||||
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
|
||||
"@mapbox/point-geometry": "^0.1.0",
|
||||
"@mapbox/unitbezier": "^0.0.0",
|
||||
"csscolorparser": "~1.0.2",
|
||||
"json-stringify-pretty-compact": "^2.0.0",
|
||||
"minimist": "^1.2.6",
|
||||
"rw": "^1.3.3",
|
||||
"sort-object": "^0.3.2"
|
||||
},
|
||||
"bin": {
|
||||
"gl-style-composite": "bin/gl-style-composite.js",
|
||||
"gl-style-format": "bin/gl-style-format.js",
|
||||
"gl-style-migrate": "bin/gl-style-migrate.js",
|
||||
"gl-style-validate": "bin/gl-style-validate.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@mapbox/mapbox-gl-style-spec/node_modules/json-stringify-pretty-compact": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz",
|
||||
"integrity": "sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ=="
|
||||
},
|
||||
"node_modules/@mapbox/node-pre-gyp": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz",
|
||||
@@ -2054,16 +2020,6 @@
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/@mapbox/point-geometry": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz",
|
||||
"integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
|
||||
},
|
||||
"node_modules/@mapbox/unitbezier": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
|
||||
"integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
|
||||
},
|
||||
"node_modules/@mdx-js/mdx": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-2.3.0.tgz",
|
||||
@@ -2701,11 +2657,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-6.11.0.tgz",
|
||||
"integrity": "sha512-AanzbulOHljrku1NGfafxdpTCfw2ENaWzH01N2vqQM+cUFbk868Cgh0xylz0JIM9BoKbfI++bdD6EYX0Q/UTEw=="
|
||||
},
|
||||
"node_modules/@petamoriken/float16": {
|
||||
"version": "3.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.1.tgz",
|
||||
"integrity": "sha512-oj3dU9kuMy8AqrreIboVh3KCJGSQO5T+dJ8JQFl369961jTWvPLP1GIlLy0FVoWehXLoI9BXygu/yzuNiIHBlg=="
|
||||
},
|
||||
"node_modules/@pkgr/utils": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz",
|
||||
@@ -2725,14 +2676,6 @@
|
||||
"url": "https://opencollective.com/unts"
|
||||
}
|
||||
},
|
||||
"node_modules/@planet/maps": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@planet/maps/-/maps-8.1.0.tgz",
|
||||
"integrity": "sha512-THvbooWXFZYyjSdoqi6MFNqnjrfnO5Oev1tKh6ORjxFru0N69gZwUfEduRjg99VNklmaAk2BPaCatgKs5qr0XA==",
|
||||
"dependencies": {
|
||||
"react-reconciler": "^0.29.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@portaljs/ckan": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@portaljs/ckan/-/ckan-0.0.2.tgz",
|
||||
@@ -2749,25 +2692,21 @@
|
||||
},
|
||||
"node_modules/@portaljs/components": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "file:../../packages/components/portaljs-components-0.1.12.tgz",
|
||||
"integrity": "sha512-Cr+RQ7tkbIqtBNq5D8zeZEB2dOejxD0V78l/I4AbdjYI8jvQ4Evx6APEfhPs3im6LDEGrT28LslVTZJ6luslnw==",
|
||||
"resolved": "https://registry.npmjs.org/@portaljs/components/-/components-0.1.12.tgz",
|
||||
"integrity": "sha512-p7I7uOJYXo+jZgVJfgGW2RtjT02wpjsSiGb+QgQCdIdh7E1e9LKIWMx7wnaRqB1eS3Z+yxaYtG3+0tQEqyxNoQ==",
|
||||
"dependencies": {
|
||||
"@githubocto/flat-ui": "^0.14.1",
|
||||
"@heroicons/react": "^2.0.17",
|
||||
"@planet/maps": "^8.1.0",
|
||||
"@tanstack/react-table": "^8.8.5",
|
||||
"chroma-js": "^2.4.2",
|
||||
"flexsearch": "0.7.21",
|
||||
"leaflet": "^1.9.4",
|
||||
"next-mdx-remote": "^4.4.1",
|
||||
"ol": "^7.4.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.43.9",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"react-query": "^3.39.3",
|
||||
"react-vega": "^7.6.0",
|
||||
"rollup-plugin-re": "^1.0.7",
|
||||
"vega": "5.25.0",
|
||||
"vega-lite": "5.1.0",
|
||||
"vitest": "^0.31.4"
|
||||
@@ -2970,16 +2909,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@reach/observe-rect/-/observe-rect-1.2.0.tgz",
|
||||
"integrity": "sha512-Ba7HmkFgfQxZqqaeIWWkNK0rEhpxVQHIoVyW1YDSkGsGIXzcaW4deC8B0pZrNSSyLTdIk7y+5olKt5+g0GmFIQ=="
|
||||
},
|
||||
"node_modules/@react-leaflet/core": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-2.1.0.tgz",
|
||||
"integrity": "sha512-Qk7Pfu8BSarKGqILj4x7bCSZ1pjuAPZ+qmRwH5S7mDS91VSbVVsJSrW4qA+GPrro8t69gFYVMWb1Zc4yFmPiVg==",
|
||||
"peerDependencies": {
|
||||
"leaflet": "^1.9.0",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/eslint-patch": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz",
|
||||
@@ -4495,11 +4424,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/chroma-js": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.4.2.tgz",
|
||||
"integrity": "sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A=="
|
||||
},
|
||||
"node_modules/clean-set": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-set/-/clean-set-1.1.2.tgz",
|
||||
@@ -4811,11 +4735,6 @@
|
||||
"resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.2.tgz",
|
||||
"integrity": "sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA=="
|
||||
},
|
||||
"node_modules/csscolorparser": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz",
|
||||
"integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="
|
||||
},
|
||||
"node_modules/cssesc": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
||||
@@ -5939,11 +5858,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/earcut": {
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
|
||||
"integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
|
||||
},
|
||||
"node_modules/ecdsa-sig-formatter": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
|
||||
@@ -7241,39 +7155,6 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/geotiff": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.0.7.tgz",
|
||||
"integrity": "sha512-FKvFTNowMU5K6lHYY2f83d4lS2rsCNdpUC28AX61x9ZzzqPNaWFElWv93xj0eJFaNyOYA63ic5OzJ88dHpoA5Q==",
|
||||
"dependencies": {
|
||||
"@petamoriken/float16": "^3.4.7",
|
||||
"lerc": "^3.0.0",
|
||||
"pako": "^2.0.4",
|
||||
"parse-headers": "^2.0.2",
|
||||
"quick-lru": "^6.1.1",
|
||||
"web-worker": "^1.2.0",
|
||||
"xml-utils": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.19"
|
||||
}
|
||||
},
|
||||
"node_modules/geotiff/node_modules/pako": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
|
||||
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
|
||||
},
|
||||
"node_modules/geotiff/node_modules/quick-lru": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.1.tgz",
|
||||
"integrity": "sha512-S27GBT+F0NTRiehtbrgaSE1idUAJ5bX8dPAQTdylEyNlrdcH5X4Lz7Edz3DYzecbsCluD5zO8ZNEe04z3D3u6Q==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
@@ -7950,7 +7831,9 @@
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
],
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.2.4",
|
||||
@@ -8901,16 +8784,6 @@
|
||||
"resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz",
|
||||
"integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg=="
|
||||
},
|
||||
"node_modules/leaflet": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
|
||||
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA=="
|
||||
},
|
||||
"node_modules/lerc": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz",
|
||||
"integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww=="
|
||||
},
|
||||
"node_modules/levn": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||
@@ -9083,6 +8956,14 @@
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "0.16.0",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.16.0.tgz",
|
||||
"integrity": "sha512-c4BEos3y6G2qO0B9X7K0FVLOPT9uGrjYwYRLFmDqyl5YMboUviyecnXWp94fJTSMwPw2/sf+CEYt5AGpmklkkQ==",
|
||||
"dependencies": {
|
||||
"vlq": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
|
||||
@@ -9142,11 +9023,6 @@
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/mapbox-to-css-font": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.2.tgz",
|
||||
"integrity": "sha512-f+NBjJJY4T3dHtlEz1wCG7YFlkODEjFIYlxDdLIDMNpkSksqTt+l/d4rjuwItxuzkuMFvPyrjzV2lxRM4ePcIA=="
|
||||
},
|
||||
"node_modules/markdown-extensions": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz",
|
||||
@@ -11616,32 +11492,6 @@
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/ol": {
|
||||
"version": "7.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ol/-/ol-7.4.0.tgz",
|
||||
"integrity": "sha512-bgBbiah694HhC0jt8ptEFNRXwgO8d6xWH3G97PCg4bmn9Li5nLLbi59oSrvqUI6VPVwonPQF1YcqJymxxyMC6A==",
|
||||
"dependencies": {
|
||||
"earcut": "^2.2.3",
|
||||
"geotiff": "^2.0.7",
|
||||
"ol-mapbox-style": "^10.1.0",
|
||||
"pbf": "3.2.1",
|
||||
"rbush": "^3.0.1"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/openlayers"
|
||||
}
|
||||
},
|
||||
"node_modules/ol-mapbox-style": {
|
||||
"version": "10.6.0",
|
||||
"resolved": "https://registry.npmjs.org/ol-mapbox-style/-/ol-mapbox-style-10.6.0.tgz",
|
||||
"integrity": "sha512-s86QhCoyyKVRsYkvPzzdWd///bhYh3onWrBq4lNXnCd9G/hS6AoK023kn4zlDESVlTBDTWLz8vhOistp0M3TXA==",
|
||||
"dependencies": {
|
||||
"@mapbox/mapbox-gl-style-spec": "^13.23.1",
|
||||
"mapbox-to-css-font": "^2.4.1",
|
||||
"ol": "^7.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@@ -11788,11 +11638,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/parse-headers": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz",
|
||||
"integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA=="
|
||||
},
|
||||
"node_modules/parse-json": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
|
||||
@@ -11890,18 +11735,6 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/pbf": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
|
||||
"integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
|
||||
"dependencies": {
|
||||
"ieee754": "^1.1.12",
|
||||
"resolve-protobuf-schema": "^2.1.0"
|
||||
},
|
||||
"bin": {
|
||||
"pbf": "bin/pbf"
|
||||
}
|
||||
},
|
||||
"node_modules/pend": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||
@@ -12222,11 +12055,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/protocol-buffers-schema": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||
"integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
@@ -12345,19 +12173,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/quickselect": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
|
||||
"integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
|
||||
},
|
||||
"node_modules/rbush": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz",
|
||||
"integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==",
|
||||
"dependencies": {
|
||||
"quickselect": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "18.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
|
||||
@@ -12406,19 +12221,6 @@
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-leaflet": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-4.2.1.tgz",
|
||||
"integrity": "sha512-p9chkvhcKrWn/H/1FFeVSqLdReGwn2qmiobOQGO3BifX+/vV/39qhY8dGqbdcPh1e6jxh/QHriLXr7a4eLFK4Q==",
|
||||
"dependencies": {
|
||||
"@react-leaflet/core": "^2.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"leaflet": "^1.9.0",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-markdown": {
|
||||
"version": "8.0.7",
|
||||
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-8.0.7.tgz",
|
||||
@@ -12488,21 +12290,6 @@
|
||||
"react-dom": "^16.8.0-0 || ^17.0.0-0 || ^18.0.0-0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-reconciler": {
|
||||
"version": "0.29.0",
|
||||
"resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.0.tgz",
|
||||
"integrity": "sha512-wa0fGj7Zht1EYMRhKWwoo1H9GApxYLBuhoAuXN0TlltESAjDssB+Apf0T/DngVqaMyPypDmabL37vw/2aRM98Q==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"scheduler": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-refresh": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz",
|
||||
@@ -13041,14 +12828,6 @@
|
||||
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-protobuf-schema": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
|
||||
"integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
|
||||
"dependencies": {
|
||||
"protocol-buffers-schema": "^3.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/retext": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz",
|
||||
@@ -13170,6 +12949,28 @@
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-re": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-re/-/rollup-plugin-re-1.0.7.tgz",
|
||||
"integrity": "sha512-TyFf3QaV/eJ/50k4wp5BM0SodGy0Idq0uOgvA1q3gHRwgXLPVX5y3CRKkBuHzKTZPC9CTZX7igKw5UvgjDls8w==",
|
||||
"dependencies": {
|
||||
"magic-string": "^0.16.0",
|
||||
"rollup-pluginutils": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-pluginutils": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
|
||||
"integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
|
||||
"dependencies": {
|
||||
"estree-walker": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-pluginutils/node_modules/estree-walker": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
|
||||
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w=="
|
||||
},
|
||||
"node_modules/rtl-css-js": {
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.1.tgz",
|
||||
@@ -13513,34 +13314,6 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/sort-asc": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz",
|
||||
"integrity": "sha512-jBgdDd+rQ+HkZF2/OHCmace5dvpos/aWQpcxuyRs9QUbPRnkEJmYVo81PIGpjIdpOcsnJ4rGjStfDHsbn+UVyw==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sort-desc": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.1.1.tgz",
|
||||
"integrity": "sha512-jfZacW5SKOP97BF5rX5kQfJmRVZP5/adDUTY8fCSPvNcXDVpUEe2pr/iKGlcyZzchRJZrswnp68fgk3qBXgkJw==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sort-object": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/sort-object/-/sort-object-0.3.2.tgz",
|
||||
"integrity": "sha512-aAQiEdqFTTdsvUFxXm3umdo04J7MRljoVGbBlkH7BgNsMvVNAJyGj7C/wV1A8wHWAJj/YikeZbfuCKqhggNWGA==",
|
||||
"dependencies": {
|
||||
"sort-asc": "^0.1.0",
|
||||
"sort-desc": "^0.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
@@ -16191,6 +15964,11 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/vlq": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz",
|
||||
"integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow=="
|
||||
},
|
||||
"node_modules/warning": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
|
||||
@@ -16395,11 +16173,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/xml-utils": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.7.0.tgz",
|
||||
"integrity": "sha512-bWB489+RQQclC7A9OW8e5BzbT8Tu//jtAOvkYwewFr+Q9T9KDGvfzC1lp0pYPEQPEoPQLDkmxkepSC/2gIAZGw=="
|
||||
},
|
||||
"node_modules/xtend": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@heroicons/react": "^2.0.18",
|
||||
"@octokit/plugin-throttling": "^5.2.2",
|
||||
"@portaljs/ckan": "^0.0.2",
|
||||
"@portaljs/components": "0.1.12",
|
||||
"@portaljs/components": "^0.1.12",
|
||||
"@portaljs/core": "^1.0.5",
|
||||
"@portaljs/remark-callouts": "^1.0.5",
|
||||
"@portaljs/remark-embed": "^1.0.4",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { AppProps } from 'next/app';
|
||||
import '@portaljs/components/styles.css';
|
||||
import './styles.css';
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
|
||||
@@ -4,12 +4,7 @@ import { GetStaticProps } from 'next';
|
||||
import Layout from '../../components/_shared/Layout';
|
||||
import { formatDate } from '@/utils/formatDate';
|
||||
import parse from '../../lib/markdown';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
const DataRichDocument = dynamic(
|
||||
() => import('../../components/DataRichDocument'),
|
||||
{ ssr: false }
|
||||
);
|
||||
import DataRichDocument from '../../components/DataRichDocument';
|
||||
|
||||
export default function Page({ source, meta }) {
|
||||
return (
|
||||
@@ -51,10 +46,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const mddb = await clientPromise;
|
||||
let allDocuments = await mddb.getFiles({
|
||||
extensions: ['mdx'],
|
||||
folder: 'stories',
|
||||
});
|
||||
let allDocuments = await mddb.getFiles({ extensions: ['mdx'], folder: 'stories' });
|
||||
|
||||
const paths = allDocuments
|
||||
.filter((page) => page.metadata?.isDraft !== true)
|
||||
|
||||
1631
package-lock.json
generated
@@ -1,8 +1,6 @@
|
||||
{
|
||||
"name": "portaljs",
|
||||
"workspaces": [
|
||||
"./packages/*"
|
||||
],
|
||||
"workspaces": ["./packages/*"],
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
10
packages/components/.storybook/preview-head.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!--
|
||||
This is necessary for Leaflet maps to work.
|
||||
-->
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
||||
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
||||
crossorigin=""
|
||||
/>
|
||||
@@ -1,25 +1,5 @@
|
||||
# @portaljs/components
|
||||
|
||||
## 0.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#980](https://github.com/datopian/portaljs/pull/980) [`38738525`](https://github.com/datopian/portaljs/commit/3873852567b1aab4827a716bd588bd5de3223e2b) Thanks [@demenech](https://github.com/demenech)! - Fix missing CSS styles for PDF component
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [`2e13c1b7`](https://github.com/datopian/portaljs/commit/2e13c1b738ddac91a9419f5c0484406328bd1cd3) Thanks [@demenech](https://github.com/demenech)! - PDF and Excel components
|
||||
|
||||
- [#973](https://github.com/datopian/portaljs/pull/973) [`f3c2a2ff`](https://github.com/datopian/portaljs/commit/f3c2a2ffa7dcf9693bd25318c719ce58d27070b8) Thanks [@demenech](https://github.com/demenech)! - Implement <Excel /> component
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [`80c6221a`](https://github.com/datopian/portaljs/commit/80c6221a05733f8c1dd0431bed4d72b1f9d7d636) Thanks [@luccasmmg](https://github.com/luccasmmg)! - Added the OpenLayers and the Map(Leaflet based) component
|
||||
|
||||
## 0.1.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@portaljs/components",
|
||||
"version": "0.3.1",
|
||||
"version": "0.1.12",
|
||||
"type": "module",
|
||||
"description": "https://portaljs.org",
|
||||
"keywords": [
|
||||
@@ -17,7 +17,7 @@
|
||||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build",
|
||||
"build-tailwind": "NODE_ENV=production npx tailwindcss --postcss -c tailwind.config.js -i src/index.css -o ./dist/style.css --minify",
|
||||
"build-tailwind": "NODE_ENV=production npx tailwindcss --postcss -c tailwind.config.js -i src/index.css -o ./dist/styles.css --minify",
|
||||
"prepare": "npm run build",
|
||||
"fix-leaflet": "node ./scripts/fix-leaflet.cjs"
|
||||
},
|
||||
@@ -30,14 +30,12 @@
|
||||
"@heroicons/react": "^2.0.17",
|
||||
"@planet/maps": "^8.1.0",
|
||||
"@tanstack/react-table": "^8.8.5",
|
||||
"ag-grid-react": "^30.0.4",
|
||||
"chroma-js": "^2.4.2",
|
||||
"flexsearch": "0.7.21",
|
||||
"leaflet": "^1.9.4",
|
||||
"next-mdx-remote": "^4.4.1",
|
||||
"ol": "^7.4.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"postcss-url": "^10.1.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.43.9",
|
||||
@@ -46,11 +44,7 @@
|
||||
"react-vega": "^7.6.0",
|
||||
"vega": "5.25.0",
|
||||
"vega-lite": "5.1.0",
|
||||
"vitest": "^0.31.4",
|
||||
"@react-pdf-viewer/core": "3.6.0",
|
||||
"@react-pdf-viewer/default-layout": "3.6.0",
|
||||
"pdfjs-dist": "2.15.349",
|
||||
"xlsx": "^0.18.5"
|
||||
"vitest": "^0.31.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-essentials": "^7.0.7",
|
||||
@@ -99,7 +93,7 @@
|
||||
"require": "./dist/components.umd.js"
|
||||
},
|
||||
"./styles.css": {
|
||||
"import": "./dist/style.css"
|
||||
"import": "./dist/styles.css"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
console.log('PostCSS');
|
||||
console.log('PostCSS')
|
||||
|
||||
export default {
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
'postcss-url': { url: 'inline' },
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import LoadingSpinner from './LoadingSpinner';
|
||||
import { read, utils } from 'xlsx';
|
||||
import { AgGridReact } from 'ag-grid-react';
|
||||
import 'ag-grid-community/styles/ag-grid.css';
|
||||
import 'ag-grid-community/styles/ag-theme-alpine.css';
|
||||
|
||||
export type ExcelProps = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
export function Excel({ url }: ExcelProps) {
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [activeSheetName, setActiveSheetName] = useState<string>();
|
||||
const [workbook, setWorkbook] = useState<any>();
|
||||
const [rows, setRows] = useState<any>();
|
||||
const [cols, setCols] = useState<any>();
|
||||
|
||||
const loadSpreadsheet = (wb: any, name: string) => {
|
||||
setActiveSheetName(name);
|
||||
const ws = wb.Sheets[name];
|
||||
|
||||
const range = utils.decode_range(ws['!ref'] || 'A1');
|
||||
const columns = Array.from({ length: range.e.c + 1 }, (_, i) => ({
|
||||
field: utils.encode_col(i),
|
||||
}));
|
||||
|
||||
const rowsAr = utils.sheet_to_json(ws, { header: 1 });
|
||||
const rows = rowsAr.map((row) => {
|
||||
const obj = {};
|
||||
columns.forEach((col, i) => {
|
||||
obj[col.field] = row[i];
|
||||
});
|
||||
return obj;
|
||||
});
|
||||
|
||||
setRows(rows);
|
||||
setCols(columns);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setIsLoading(true);
|
||||
|
||||
fetch(url)
|
||||
.then((res) => res.arrayBuffer())
|
||||
.then((f) => {
|
||||
const wb = read(f);
|
||||
setWorkbook(wb);
|
||||
loadSpreadsheet(wb, wb.SheetNames[0]);
|
||||
setIsLoading(false);
|
||||
});
|
||||
}, [url]);
|
||||
|
||||
return isLoading ? (
|
||||
<div className="w-full flex items-center justify-center w-[600px] h-[300px]">
|
||||
<LoadingSpinner />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{cols && rows && (
|
||||
<div>
|
||||
<div
|
||||
className="ag-theme-alpine"
|
||||
style={{ height: 400, width: '100%' }}
|
||||
>
|
||||
<AgGridReact
|
||||
rowData={rows}
|
||||
columnDefs={cols}
|
||||
defaultColDef={{
|
||||
resizable: true,
|
||||
minWidth: 200,
|
||||
flex: 1,
|
||||
sortable: true,
|
||||
filter: true,
|
||||
}}
|
||||
></AgGridReact>
|
||||
</div>
|
||||
<div className="border-t">
|
||||
{workbook.SheetNames.map((name: string, idx: number) => {
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
key={idx}
|
||||
className={`text-sm px-3 pb-2 pt-4 border-b border-l border-r ${
|
||||
name == activeSheetName ? 'font-semibold' : ''
|
||||
}`}
|
||||
onClick={() => loadSpreadsheet(workbook, name)}
|
||||
>
|
||||
{name}
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,87 +6,93 @@ import {
|
||||
MapContainer,
|
||||
TileLayer,
|
||||
GeoJSON as GeoJSONLayer,
|
||||
LayersControl,
|
||||
} from 'react-leaflet';
|
||||
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import * as L from 'leaflet';
|
||||
|
||||
export type MapProps = {
|
||||
layers: {
|
||||
data: string | GeoJSON.GeoJSON;
|
||||
name: string;
|
||||
colorScale?: {
|
||||
starting: string;
|
||||
ending: string;
|
||||
};
|
||||
tooltip?:
|
||||
| {
|
||||
propNames: string[];
|
||||
}
|
||||
| boolean;
|
||||
_id?: number;
|
||||
}[];
|
||||
data: string | GeoJSON.GeoJSON;
|
||||
title?: string;
|
||||
colorScale?: {
|
||||
starting: string;
|
||||
ending: string;
|
||||
};
|
||||
center?: { latitude: number | undefined; longitude: number | undefined };
|
||||
zoom?: number;
|
||||
tooltip?: {
|
||||
prop: string;
|
||||
};
|
||||
};
|
||||
|
||||
export function Map({
|
||||
layers = [
|
||||
{
|
||||
data: null,
|
||||
name: null,
|
||||
colorScale: { starting: 'blue', ending: 'red' },
|
||||
tooltip: true,
|
||||
},
|
||||
],
|
||||
data,
|
||||
title = '',
|
||||
colorScale = { starting: 'blue', ending: 'red' },
|
||||
center = { latitude: 45, longitude: 45 },
|
||||
zoom = 2,
|
||||
title = '',
|
||||
tooltip = {
|
||||
prop: '',
|
||||
},
|
||||
}: MapProps) {
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [layersData, setLayersData] = useState<any>([]);
|
||||
|
||||
// By default, assumes data is an Array...
|
||||
const [geoJsonData, setGeoJsonData] = useState<any>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const loadDataPromises = layers.map(async (layer) => {
|
||||
let layerData: any;
|
||||
// If data is string, assume it's a URL
|
||||
if (typeof data === 'string') {
|
||||
setIsLoading(true);
|
||||
|
||||
if (typeof layer.data === 'string') {
|
||||
// If "data" is string, assume it's a URL
|
||||
setIsLoading(true);
|
||||
layerData = await loadData(layer.data).then((res: any) => {
|
||||
return JSON.parse(res);
|
||||
});
|
||||
} else {
|
||||
// Else, expect raw GeoJSON
|
||||
layerData = layer.data;
|
||||
}
|
||||
loadData(data).then((res: any) => {
|
||||
const geoJsonObject = JSON.parse(res);
|
||||
|
||||
if (layer.colorScale) {
|
||||
const colorScaleAr = chroma
|
||||
.scale([layer.colorScale.starting, layer.colorScale.ending])
|
||||
.scale([colorScale.starting, colorScale.ending])
|
||||
.mode('lch')
|
||||
.colors(layerData.features.length);
|
||||
.colors(geoJsonObject.features.length);
|
||||
|
||||
layerData.features.forEach((feature, i) => {
|
||||
// Only style if the feature doesn't have a color prop
|
||||
geoJsonObject.features.forEach((feature, i) => {
|
||||
if (feature.color === undefined) {
|
||||
feature.color = colorScaleAr[i];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return { name: layer.name, data: layerData };
|
||||
});
|
||||
|
||||
Promise.all(loadDataPromises).then((values) => {
|
||||
setLayersData(values);
|
||||
setIsLoading(false);
|
||||
});
|
||||
setGeoJsonData(geoJsonObject);
|
||||
setIsLoading(false);
|
||||
});
|
||||
} else {
|
||||
setGeoJsonData(data);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return isLoading ? (
|
||||
const onEachFeature = (feature, layer) => {
|
||||
const geometryType = feature.type;
|
||||
|
||||
if (tooltip.prop)
|
||||
layer.bindTooltip(feature.properties[tooltip.prop], {
|
||||
direction: 'center',
|
||||
});
|
||||
|
||||
layer.on({
|
||||
mouseover: (event) => {
|
||||
if (['Polygon', 'MultiPolygon'].includes(geometryType)) {
|
||||
event.target.setStyle({
|
||||
fillColor: '#B85042',
|
||||
});
|
||||
}
|
||||
},
|
||||
mouseout: (event) => {
|
||||
if (['Polygon', 'MultiPolygon'].includes(geometryType)) {
|
||||
event.target.setStyle({
|
||||
fillColor: '#A7BEAE',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return isLoading || !geoJsonData ? (
|
||||
<div className="w-full flex items-center justify-center w-[600px] h-[300px]">
|
||||
<LoadingSpinner />
|
||||
</div>
|
||||
@@ -98,10 +104,8 @@ export function Map({
|
||||
className="h-80 w-full"
|
||||
// @ts-ignore
|
||||
whenReady={(map: any) => {
|
||||
// Enable zoom using scroll wheel
|
||||
map.target.scrollWheelZoom.enable();
|
||||
|
||||
// Create the title box
|
||||
var info = new L.Control() as any;
|
||||
|
||||
info.onAdd = function () {
|
||||
@@ -115,119 +119,21 @@ export function Map({
|
||||
};
|
||||
|
||||
if (title) info.addTo(map.target);
|
||||
|
||||
setTimeout(() => map.target.invalidateSize(), 5000);
|
||||
}}
|
||||
>
|
||||
<GeoJSONLayer
|
||||
data={geoJsonData}
|
||||
style={(geoJsonFeature: any) => {
|
||||
return { color: geoJsonFeature?.color };
|
||||
}}
|
||||
onEachFeature={onEachFeature}
|
||||
/>
|
||||
<TileLayer
|
||||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
/>
|
||||
<LayersControl position="bottomright">
|
||||
{layers.map((layer) => {
|
||||
const data = layersData.find(
|
||||
(layerData) => layerData.name === layer.name
|
||||
)?.data;
|
||||
|
||||
return (
|
||||
data && (
|
||||
<LayersControl.Overlay key={layer.name} checked name={layer.name}>
|
||||
<GeoJSONLayer
|
||||
data={data}
|
||||
// @ts-ignore
|
||||
pointToLayer={(feature, latlng) => {
|
||||
// This resolver an issue in which the bundled map was
|
||||
// not finding the images
|
||||
const leafletBase =
|
||||
'https://unpkg.com/leaflet@1.9.4/dist/images/';
|
||||
|
||||
const icon = new L.Icon({
|
||||
iconUrl: leafletBase + 'marker-icon.png',
|
||||
iconRetinaUrl: leafletBase + 'marker-icon-2x.png',
|
||||
shadowUrl: leafletBase + 'marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
tooltipAnchor: [16, -28],
|
||||
shadowSize: [41, 41],
|
||||
});
|
||||
|
||||
const iconMarker = L.marker(latlng, { icon });
|
||||
return iconMarker;
|
||||
}}
|
||||
style={(geoJsonFeature: any) => {
|
||||
// Set the fill color of each feature when appliable
|
||||
if (
|
||||
!['Point', 'MultiPoint'].includes(geoJsonFeature.type)
|
||||
) {
|
||||
return { color: geoJsonFeature?.color };
|
||||
}
|
||||
}}
|
||||
eventHandlers={{
|
||||
add: (e) => {
|
||||
const featureGroup = e.target;
|
||||
const tooltip = layer.tooltip;
|
||||
|
||||
featureGroup.eachLayer((featureLayer) => {
|
||||
const feature = featureLayer.feature;
|
||||
const geometryType = feature.geometry.type;
|
||||
|
||||
if (tooltip) {
|
||||
const featurePropNames = Object.keys(
|
||||
feature.properties
|
||||
);
|
||||
let includedFeaturePropNames;
|
||||
|
||||
if (tooltip === true) {
|
||||
includedFeaturePropNames = featurePropNames;
|
||||
} else {
|
||||
includedFeaturePropNames = tooltip.propNames.filter(
|
||||
(name) => featurePropNames.includes(name)
|
||||
);
|
||||
}
|
||||
|
||||
if (includedFeaturePropNames) {
|
||||
const tooltipContent = includedFeaturePropNames
|
||||
.map(
|
||||
(name) =>
|
||||
`<b>${name}:</b> ${feature.properties[name]}`
|
||||
)
|
||||
.join('<br />');
|
||||
|
||||
featureLayer.bindTooltip(tooltipContent, {
|
||||
direction: 'center',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
featureLayer.on({
|
||||
mouseover: (event) => {
|
||||
if (
|
||||
['Polygon', 'MultiPolygon'].includes(geometryType)
|
||||
) {
|
||||
event.target.setStyle({
|
||||
fillOpacity: 0.5,
|
||||
});
|
||||
}
|
||||
},
|
||||
mouseout: (event) => {
|
||||
if (
|
||||
['Polygon', 'MultiPolygon'].includes(geometryType)
|
||||
) {
|
||||
event.target.setStyle({
|
||||
fillOpacity: 0.2,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
}}
|
||||
/>
|
||||
;
|
||||
</LayersControl.Overlay>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</LayersControl>
|
||||
</MapContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ interface OpenLayersProps {
|
||||
popup?: (selected: any) => JSX.Element;
|
||||
}
|
||||
|
||||
export default function OpenLayers({
|
||||
export function OpenLayers({
|
||||
layers,
|
||||
center = [0, 0],
|
||||
zoom = 1,
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
// Core viewer
|
||||
import { Viewer, Worker, SpecialZoomLevel } from '@react-pdf-viewer/core';
|
||||
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout';
|
||||
|
||||
// Import styles
|
||||
import '@react-pdf-viewer/core/lib/styles/index.css';
|
||||
import '@react-pdf-viewer/default-layout/lib/styles/index.css';
|
||||
|
||||
export interface PdfViewerProps {
|
||||
url: string;
|
||||
layout: boolean;
|
||||
parentClassName?: string;
|
||||
}
|
||||
|
||||
export function PdfViewer({
|
||||
url,
|
||||
layout = false,
|
||||
parentClassName,
|
||||
}: PdfViewerProps) {
|
||||
const defaultLayoutPluginInstance = defaultLayoutPlugin();
|
||||
return (
|
||||
<Worker workerUrl="https://unpkg.com/pdfjs-dist@2.15.349/build/pdf.worker.js">
|
||||
<div className={parentClassName}>
|
||||
<Viewer
|
||||
defaultScale={SpecialZoomLevel.PageWidth}
|
||||
fileUrl={url}
|
||||
plugins={layout ? [defaultLayoutPluginInstance] : []}
|
||||
/>
|
||||
</div>
|
||||
</Worker>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
|
||||
@import "tailwindcss/base";
|
||||
@import "tailwindcss/components";
|
||||
@import "include";
|
||||
@import "leaflet";
|
||||
@import '@react-pdf-viewer/core/lib/styles/index.css';
|
||||
@import '@react-pdf-viewer/default-layout/lib/styles/index.css';
|
||||
@import 'ag-grid-community/styles/ag-grid.css';
|
||||
@import 'ag-grid-community/styles/ag-theme-alpine.css';
|
||||
@import "include";
|
||||
@import "tailwindcss/utilities";
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
export * from './components/Table';
|
||||
export * from './components/Catalog';
|
||||
export * from './components/LineChart';
|
||||
export * from './components/Vega';
|
||||
export * from './components/VegaLite';
|
||||
export * from './components/FlatUiTable';
|
||||
export * from "./components/Table";
|
||||
export * from "./components/Catalog";
|
||||
export * from "./components/LineChart";
|
||||
export * from "./components/Vega";
|
||||
export * from "./components/VegaLite";
|
||||
export * from "./components/FlatUiTable";
|
||||
export * from './components/OpenLayers/OpenLayers';
|
||||
export * from './components/Map';
|
||||
export * from './components/PdfViewer';
|
||||
export * from "./components/Excel";
|
||||
export * from "./components/Map";
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { Excel, ExcelProps } from '../src/components/Excel';
|
||||
|
||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
||||
const meta: Meta = {
|
||||
title: 'Components/Excel',
|
||||
component: Excel,
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
url: {
|
||||
description:
|
||||
'Url of the file to be displayed e.g.: "https://url.to/data.csv"',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<ExcelProps>;
|
||||
|
||||
export const SingleSheet: Story = {
|
||||
name: 'Excel file with just one sheet',
|
||||
args: {
|
||||
url: 'https://sheetjs.com/pres.xlsx',
|
||||
},
|
||||
};
|
||||
|
||||
export const MultipleSheet: Story = {
|
||||
name: 'Excel file with multiple sheets',
|
||||
args: {
|
||||
url: 'https://storage.portaljs.org/IC-Gantt-Chart-Project-Template-8857.xlsx',
|
||||
},
|
||||
};
|
||||
@@ -8,7 +8,7 @@ const meta: Meta = {
|
||||
component: Map,
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
layers: {
|
||||
data: {
|
||||
description:
|
||||
'Data to be displayed.\n\n GeoJSON Object \n\nOR\n\n URL to GeoJSON Object',
|
||||
},
|
||||
@@ -21,6 +21,9 @@ const meta: Meta = {
|
||||
zoom: {
|
||||
description: 'Zoom level',
|
||||
},
|
||||
tooltip: {
|
||||
description: 'Tooltip settings'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -32,60 +35,21 @@ type Story = StoryObj<MapProps>;
|
||||
export const GeoJSONPolygons: Story = {
|
||||
name: 'GeoJSON polygons map',
|
||||
args: {
|
||||
layers: [
|
||||
{
|
||||
data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_geography_marine_polys.geojson',
|
||||
name: 'Polygons',
|
||||
tooltip: { propNames: ['name'] },
|
||||
colorScale: {
|
||||
starting: '#ff0000',
|
||||
ending: '#00ff00',
|
||||
},
|
||||
},
|
||||
],
|
||||
data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_geography_marine_polys.geojson',
|
||||
title: 'Seas and Oceans Map',
|
||||
center: { latitude: 45, longitude: 0 },
|
||||
zoom: 2,
|
||||
tooltip: { prop: 'name' },
|
||||
},
|
||||
};
|
||||
|
||||
export const GeoJSONPoints: Story = {
|
||||
name: 'GeoJSON points map',
|
||||
args: {
|
||||
layers: [
|
||||
{
|
||||
data: 'https://opendata.arcgis.com/datasets/9c58741995174fbcb017cf46c8a42f4b_25.geojson',
|
||||
name: 'Points',
|
||||
tooltip: { propNames: ['Location'] },
|
||||
},
|
||||
],
|
||||
data: 'https://opendata.arcgis.com/datasets/9c58741995174fbcb017cf46c8a42f4b_25.geojson',
|
||||
title: 'Roads in York',
|
||||
center: { latitude: 53.9614, longitude: -1.0739 },
|
||||
zoom: 12,
|
||||
},
|
||||
};
|
||||
|
||||
export const GeoJSONMultipleLayers: Story = {
|
||||
name: 'GeoJSON polygons and points map',
|
||||
args: {
|
||||
layers: [
|
||||
{
|
||||
data: 'https://opendata.arcgis.com/datasets/9c58741995174fbcb017cf46c8a42f4b_25.geojson',
|
||||
name: 'Points',
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_geography_marine_polys.geojson',
|
||||
name: 'Polygons',
|
||||
tooltip: true,
|
||||
colorScale: {
|
||||
starting: '#ff0000',
|
||||
ending: '#00ff00',
|
||||
},
|
||||
},
|
||||
],
|
||||
title: 'Polygons and points',
|
||||
center: { latitude: 45, longitude: 0 },
|
||||
zoom: 2,
|
||||
tooltip: { prop: 'Location' },
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import React from 'react';
|
||||
import OpenLayers from '../src/components/OpenLayers/OpenLayers';
|
||||
import { OpenLayers } from '../src/components/OpenLayers/OpenLayers';
|
||||
|
||||
const meta: Meta = {
|
||||
title: 'Components/OpenLayers',
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { PdfViewer, PdfViewerProps } from '../src/components/PdfViewer';
|
||||
|
||||
const meta: Meta = {
|
||||
title: 'Components/PdfViewer',
|
||||
component: PdfViewer,
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
url: {
|
||||
description: 'URL to PDF file',
|
||||
},
|
||||
parentClassName: {
|
||||
description: 'Classname for the parent div of the pdf viewer',
|
||||
},
|
||||
layour: {
|
||||
description:
|
||||
'Set to true if you want to have a layout with zoom level, page count, printing button etc',
|
||||
defaultValue: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<PdfViewerProps>;
|
||||
|
||||
export const PdfViewerStory: Story = {
|
||||
name: 'PdfViewer',
|
||||
args: {
|
||||
url: 'https://cdn.filestackcontent.com/wcrjf9qPTCKXV3hMXDwK',
|
||||
},
|
||||
};
|
||||
|
||||
export const PdfViewerStoryWithLayout: Story = {
|
||||
name: 'PdfViewer with the default layout',
|
||||
args: {
|
||||
url: 'https://cdn.filestackcontent.com/wcrjf9qPTCKXV3hMXDwK',
|
||||
layout: true,
|
||||
},
|
||||
};
|
||||
|
||||
export const PdfViewerStoryWithHeight: Story = {
|
||||
name: 'PdfViewer with a custom height',
|
||||
args: {
|
||||
url: 'https://cdn.filestackcontent.com/wcrjf9qPTCKXV3hMXDwK',
|
||||
parentClassName: 'h-96',
|
||||
layout: true,
|
||||
},
|
||||
};
|
||||
@@ -1,10 +1,6 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
'./index.html',
|
||||
'./src/**/*.{js,ts,jsx,tsx}',
|
||||
'./stories/*.{js,ts,jsx,tsx}',
|
||||
],
|
||||
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
|
||||
theme: {},
|
||||
plugins: [],
|
||||
};
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import react from '@vitejs/plugin-react';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import path from 'node:path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import dts from 'vite-plugin-dts';
|
||||
import tailwindcss from 'tailwindcss';
|
||||
import { UserConfigExport } from 'vite';
|
||||
import replace from 'rollup-plugin-re';
|
||||
|
||||
const app = async (): Promise<UserConfigExport> => {
|
||||
return defineConfig({
|
||||
@@ -36,7 +37,7 @@ const app = async (): Promise<UserConfigExport> => {
|
||||
'vega',
|
||||
'react-vega',
|
||||
'ol',
|
||||
'leaflet',
|
||||
'leaflet'
|
||||
],
|
||||
output: {
|
||||
manualChunks: undefined,
|
||||
@@ -47,7 +48,7 @@ const app = async (): Promise<UserConfigExport> => {
|
||||
'react-vega': 'react-vega',
|
||||
'react-dom': 'ReactDOM',
|
||||
tailwindcss: 'tailwindcss',
|
||||
leaflet: 'leaflet',
|
||||
leaflet: 'leaflet'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
5
site/.gitignore
vendored
@@ -35,8 +35,3 @@ yarn-error.log*
|
||||
|
||||
# markdowndb
|
||||
markdown.db
|
||||
|
||||
# seo
|
||||
robots.txt
|
||||
sitemap-0.xml
|
||||
sitemap.xml
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function Features() {
|
||||
>
|
||||
<div className="absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.blue.300),theme(colors.blue.400),theme(colors.blue.500))_border-box] group-hover:opacity-100 dark:[--quick-links-hover-bg:theme(colors.slate.800)]" />
|
||||
<div className="relative overflow-hidden rounded-xl p-6">
|
||||
<img src={feature.icon} alt={feature.title} className="h-24 w-auto" />
|
||||
<img src={feature.icon} alt="" className="h-24 w-auto" />
|
||||
<h2 className="mt-4 font-display text-base text-primary dark:text-primary-dark">
|
||||
<span className="absolute -inset-px rounded-xl" />
|
||||
{feature.title}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useRef } from 'react';
|
||||
import ButtonLink from './ButtonLink';
|
||||
import NewsletterForm from './NewsletterForm';
|
||||
import Image from 'next/image';
|
||||
import DatahubExampleImg from '@/public/images/showcases/datahub.webp';
|
||||
import DatahubExampleImg from "@/public/images/showcases/datahub.png"
|
||||
|
||||
const codeLanguage = 'javascript';
|
||||
const code = `export default {
|
||||
@@ -41,7 +41,7 @@ export function Hero() {
|
||||
{/* Commented code on line 37, 39 and 113 will reenable the two columns hero */}
|
||||
<div className="mx-auto grid max-w-2xl grid-cols-1 gap-y-16 gap-x-8 px-4 lg:max-w-8xl lg:grid-cols-2 lg:px-8 xl:gap-x-16 xl:px-12">
|
||||
<div className="relative mb-10 lg:mb-0 md:text-center lg:text-left">
|
||||
<div>
|
||||
<div role="heading">
|
||||
<h1 className="inline bg-gradient-to-r from-blue-500 via-blue-300 to-blue-500 bg-clip-text text-5xl tracking-tight text-transparent">
|
||||
The JavaScript framework for data portals
|
||||
</h1>
|
||||
@@ -72,11 +72,9 @@ export function Hero() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<Image
|
||||
<img
|
||||
src="/images/datopian_logo.png"
|
||||
alt="Datopian"
|
||||
width={24}
|
||||
height={20}
|
||||
className="mx-2 mb-1 h-6 inline bg-black rounded-full"
|
||||
/>
|
||||
<span>Datopian</span>
|
||||
@@ -87,12 +85,7 @@ export function Hero() {
|
||||
<div className="relative rounded-2xl bg-[#0A101F]/80 ring-1 ring-white/10 backdrop-blur">
|
||||
<div className="absolute -top-px left-20 right-11 h-px bg-gradient-to-r from-sky-300/0 via-sky-300/70 to-sky-300/0" />
|
||||
<div className="absolute -bottom-px left-11 right-20 h-px bg-gradient-to-r from-blue-400/0 via-blue-400 to-blue-400/0" />
|
||||
<Image
|
||||
height={400}
|
||||
width={600}
|
||||
src={DatahubExampleImg}
|
||||
alt="opendata.datahub.io"
|
||||
/>
|
||||
<Image src={DatahubExampleImg} alt="opendata.datahub.io" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
import { ArticleJsonLd } from 'next-seo';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function JSONLD({
|
||||
meta,
|
||||
source,
|
||||
}: {
|
||||
meta: any;
|
||||
source: string;
|
||||
}): JSX.Element {
|
||||
if (!source) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://portaljs.org';
|
||||
const pageUrl = `${baseUrl}/${meta.urlPath}`;
|
||||
|
||||
const imageMatches = source.match(
|
||||
/(?<=src: ")(.*)\.((png)|(jpg)|(jpeg))(?=")/g
|
||||
);
|
||||
let images = [];
|
||||
if (imageMatches) {
|
||||
images = [...imageMatches];
|
||||
images = images.map((img) =>
|
||||
img.startsWith('http')
|
||||
? img
|
||||
: `${baseUrl}${img.startsWith('/') ? '' : '/'}${img}`
|
||||
);
|
||||
}
|
||||
|
||||
let Component: JSX.Element;
|
||||
|
||||
const isBlog: boolean =
|
||||
/^blog\/.*/.test(meta.urlPath) || meta.filetype === 'blog';
|
||||
const isDoc: boolean = /^((docs)|(howtos\/)|(guide\/)).*/.test(meta.urlPath);
|
||||
|
||||
if (isBlog) {
|
||||
Component = (
|
||||
<ArticleJsonLd
|
||||
type="BlogPosting"
|
||||
url={pageUrl}
|
||||
title={meta.title}
|
||||
datePublished={meta.date}
|
||||
dateModified={meta.date}
|
||||
authorName={meta.authors.length ? meta.authors[0].name : 'PortalJS'}
|
||||
description={meta.description}
|
||||
images={images}
|
||||
/>
|
||||
);
|
||||
} else if (isDoc) {
|
||||
Component = (
|
||||
<ArticleJsonLd
|
||||
url={pageUrl}
|
||||
title={meta.title}
|
||||
images={images}
|
||||
datePublished={meta.date}
|
||||
dateModified={meta.date}
|
||||
authorName={meta.authors.length ? meta.authors[0].name : 'PortalJS'}
|
||||
description={meta.description}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return Component;
|
||||
}
|
||||
@@ -54,14 +54,12 @@ function useTableOfContents(tableOfContents) {
|
||||
export default function Layout({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
tableOfContents = [],
|
||||
isHomePage = false,
|
||||
sidebarTree = [],
|
||||
}: {
|
||||
children;
|
||||
title?: string;
|
||||
description?: string;
|
||||
tableOfContents?;
|
||||
urlPath?: string;
|
||||
sidebarTree?: [];
|
||||
@@ -84,7 +82,7 @@ export default function Layout({
|
||||
|
||||
return (
|
||||
<>
|
||||
{title && <NextSeo title={title} description={description} />}
|
||||
{title && <NextSeo title={title} />}
|
||||
<Nav />
|
||||
<div className="mx-auto p-6 bg-background dark:bg-background-dark">
|
||||
{isHomePage && <Hero />}
|
||||
|
||||
@@ -12,6 +12,7 @@ export default function MDXPage({ source, frontMatter }) {
|
||||
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<MDXRemote {...source} components={{ DocsPagination, NextSeo, Hero }} />
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function NavItem({ item }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Menu as="div" role="menu" className="relative">
|
||||
<Menu as="div" className="relative">
|
||||
<Menu.Item>
|
||||
{Object.prototype.hasOwnProperty.call(item, 'href') ? (
|
||||
<Link
|
||||
|
||||
@@ -3,6 +3,10 @@ import Script from 'next/script';
|
||||
export default function NewsletterForm() {
|
||||
return (
|
||||
<div>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://sibforms.com/forms/end-form/build/sib-styles.css"
|
||||
/>
|
||||
<div
|
||||
id="sib-form-container"
|
||||
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
|
||||
@@ -115,7 +119,6 @@ export default function NewsletterForm() {
|
||||
}}
|
||||
/>
|
||||
<Script
|
||||
strategy="worker"
|
||||
id="newsletter-submit-form"
|
||||
src="https://sibforms.com/forms/end-form/build/main.js"
|
||||
/>
|
||||
|
||||
@@ -5,26 +5,26 @@ const items = [
|
||||
{
|
||||
title: 'Open Data Northern Ireland',
|
||||
href: 'https://www.opendatani.gov.uk/',
|
||||
image: '/images/showcases/odni.webp',
|
||||
image: '/images/showcases/odni.png',
|
||||
description: 'Government Open Data Portal',
|
||||
},
|
||||
{
|
||||
title: 'Birmingham City Observatory',
|
||||
href: 'https://www.cityobservatory.birmingham.gov.uk/',
|
||||
image: '/images/showcases/birmingham.webp',
|
||||
image: '/images/showcases/birmingham.png',
|
||||
description: 'Government Open Data Portal',
|
||||
},
|
||||
{
|
||||
title: 'UAE Open Data',
|
||||
href: 'https://opendata.fcsc.gov.ae/',
|
||||
image: '/images/showcases/uae.webp',
|
||||
image: '/images/showcases/uae.png',
|
||||
description: 'Government Open Data Portal',
|
||||
sourceUrl: 'https://github.com/FCSCOpendata/frontend',
|
||||
},
|
||||
{
|
||||
title: 'Datahub Open Data',
|
||||
href: 'https://opendata.datahub.io/',
|
||||
image: '/images/showcases/datahub.webp',
|
||||
image: '/images/showcases/datahub.png',
|
||||
description: 'Demo Data Portal by DataHub',
|
||||
},
|
||||
];
|
||||
|
||||
|
Before Width: | Height: | Size: 416 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 467 KiB |
|
Before Width: | Height: | Size: 792 KiB |
|
Before Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 223 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 213 KiB |
|
Before Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 271 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 305 KiB |
|
Before Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 444 KiB |
@@ -1,15 +1,15 @@
|
||||
---
|
||||
title: 'Tutorial 1: Create a website from scratch using Markdown and Flowershow'
|
||||
title: 'Tutorial 1: Create a website from scratch using Markdown and PortalJS'
|
||||
date: 2023-06-20
|
||||
authors: ['Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
In this tutorial we will walk you through creating an elegant, fully functional website written in simple markdown and published with Flowershow.
|
||||
In this tutorial we will walk you through creating an elegant, fully functional website written in simple markdown and published with PortalJS.
|
||||
|
||||
By the end of this tutorial you will:
|
||||
|
||||
- have a working markdown-based website powered by Flowershow.
|
||||
- have a working markdown-based website powered by PortalJS.
|
||||
- be able to edit the text and add pages, all from an online interface without installing anything.
|
||||
|
||||
Below is a screenshot of how the final website will look like:
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
---
|
||||
title: 'Tutorial 2: Edit your Flowershow website locally on your computer'
|
||||
date: 2023-06-22
|
||||
authors: ['Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
In this tutorial, we will walk you through the process of editing your Flowershow website locally on your computer.
|
||||
|
||||
By the end of this tutorial, you will:
|
||||
|
||||
- Understand what is Markdown and why you should use Obsidian to edit content on your Flowershow websites in most cases.
|
||||
- Gain a deeper understanding of working with Git and GitHub Desktop.
|
||||
- Learn how to clone your website's repository to your computer.
|
||||
- Learn how to edit content using Obsidian and what are the benefits of it.
|
||||
- Learn how to commit (save) your changes locally and push them back to the GitHub repository.
|
||||
|
||||
Below is a screenshot of how the final website will look like:
|
||||
|
||||
![[tutorial-2-result.png]]
|
||||
|
||||
Let's start by understanding why using GitHub UI as we did in tutorial 1 is not always a good choice.
|
||||
|
||||
## What is Markdown and why use Obsidian for editing it in Flowershow-based websites
|
||||
|
||||
While editing on the GitHub UI is convenient, there are certain limitations and drawbacks to consider. For example, you can't work offline, can't add or edit multiple files simultaneously, and the GitHub UI's preview doesn't render all the Markdown syntax elements that are supported by Flowershow-based websites.
|
||||
|
||||
Ok, but, what exactly is Markdown?
|
||||
|
||||
[Markdown](https://en.wikipedia.org/wiki/Markdown) is a simple and intuitive syntax, that allows you to structure your text documents. It's widely used for creating content on the web. As Wikipedia puts it:
|
||||
|
||||
> *Markdown is a lightweight [**markup language**](https://en.wikipedia.org/wiki/Markup_language) for creating [**formatted text**](https://en.wikipedia.org/wiki/Formatted_text) using a **plain-text editor**.*
|
||||
|
||||
The key term here is "markup language". In simple terms, it is a way to annotate or "mark up" a plain text document with symbols that describe how the document is structured and so, how it should be understood, processed, or displayed. These tags can tell a computer program that supports this syntax (e.g. a website) how to format the rendered text, for example: which words should be bold or italic, where to insert images, when to start new paragraphs, how to create tables, and so forth. It's important to note, that even though Markdown symbols change how the text is displayed when it's rendered by a Markdown-compatible viewer, the underlying document in still just a plain text. For instance, if you want to create a heading in Markdown, you use the "#" symbol before your heading text, like this:
|
||||
|
||||
```md
|
||||
# This is a Heading
|
||||
```
|
||||
|
||||
BUT, there is no single version of Markdown. It comes in different "flavours", with CommonMark and GitHub Flavoured Markdown (GFM) being the most popular ones. And different tools supporting Markdown may use their own specific versions of Markdown. The two tools relevant in the context of this guide are Obsidian and Flowershow.
|
||||
|
||||
Obsidian supports an extended version of Markdown that includes majority of elements from CommonMark and GFM, while also introducing its own unique features, like [wiki-links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) or [callouts](https://help.obsidian.md/Editing+and+formatting/Callouts). And Flowershow template is Obsidian-compatible, meaning it supports (or aims to support) all of the Obsidian Markdown features.
|
||||
|
||||
To make things a bit clearer, there are:
|
||||
|
||||
- CommonMark
|
||||
- GitHub Flavored Markdown (GFM) - superset of CommonMark
|
||||
- "Obsidian flavoured Markdown" - majority of the GFM + some extra elements, like wiki-links or callouts
|
||||
- "Flowershow flavoured Markdown" - majority of Obsidian-supported syntax
|
||||
|
||||
As you might have guessed by now, GitHub UI will only preview GitHub Flavoured Markdown. And while it's a majority of Markdown you would write, it won't be able to render Obsidian-only (or Flowershow-only) syntax elements, like callouts, wiki-links or inline table of contents.
|
||||
|
||||
Another drawback of GitHub UI, is that it doesn't allow you to make changes (or to add) multiple files at once. Changes to each file will have to be commited (saved) separately, which can introduce a bit of a mess to your GitHub history, and may be cumbersome (e.g. if you want to update a link to some page on 10 other pages...).
|
||||
|
||||
Ok, now we have this sorted, let's dive in and start editing your Flowershow website locally!
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A [GitHub](https://github.com/) account.
|
||||
- A [Vercel](https://vercel.com/) account. You can set it up using your GitHub account.
|
||||
- [Obsidian](https://obsidian.md/) installed
|
||||
- [GitHub Desktop](https://desktop.github.com/) installed
|
||||
- [[create-a-website-from-scratch|Tutorial 1: Create a website from scratch using Markdown and PortalJS]] completed - this one is recommended so that you have the same sandbox website we're working on in this tutorial.
|
||||
|
||||
## Clone the GitHub repository on your computer
|
||||
|
||||
### 1. Open GitHub Desktop app
|
||||
|
||||
### 2. Click on "Clone a Repository from the Internet..."
|
||||
|
||||
Or click on "File" -> "Clone repository".
|
||||
|
||||
![[gh-desktop-starting-screen.png]]
|
||||
|
||||
If this is the first time you're using GitHub Desktop, it will prompt you to log in to your GitHub account. Click "Sign In" and follow the prompts.
|
||||
|
||||
![[gh-desktop-clone-signin.png]]
|
||||
|
||||
Once you're done and you've authorised GitHub Desktop to access your repositories, go back to GitHub Desktop. You should now see a list of all your GitHub repositories.
|
||||
|
||||
### 3. Select the repository you want to clone
|
||||
|
||||
![[gh-desktop-clone.png]]
|
||||
|
||||
### 4. Choose where your repository should be saved
|
||||
|
||||
Type the path manually or click "Choose..." to find it using file explorer.
|
||||
|
||||
![[gh-desktop-clone-path-select.png]]
|
||||
|
||||
### 5. Click "Clone" and wait for the process to complete
|
||||
|
||||
You should now see the following screen:
|
||||
|
||||
![[gh-desktop-no-local-changes.png]]
|
||||
|
||||
Done! You've successfully cloned your website's repository on your computer! 🎉
|
||||
|
||||
## Edit your site in Obsidian
|
||||
|
||||
### 1. Open Obsidian
|
||||
|
||||
### 2. Open your repository's `/content` folder as vault
|
||||
|
||||
Click on "Open" in "Open folder as vault" section and select the path to the `/content` of the cloned repository.
|
||||
|
||||
![[obsidian-starting.png]]
|
||||
Now you're ready to edit your site! In the left-hand side panel you should see the two files we created in [[create-a-website-from-scratch|tutorial 1]]: `index.md` and `about.md`.
|
||||
|
||||
![[obsidian-content-start.png]]
|
||||
|
||||
### 3. Edit your site's content
|
||||
|
||||
Now, let's add some more stuff to the home page.
|
||||
|
||||
Click on `index.md` to open it and replace the dummy text with "About Me" section, .e.g.:
|
||||
|
||||
```md
|
||||
## About Me
|
||||
|
||||
Hey there! I'm Your Name, a passionate learner and explorer of ideas.
|
||||
```
|
||||
|
||||
![[obsidian-content-index-edit.png]]
|
||||
|
||||
Now, let's say for more information about you and your site, you want to add link to the about page. You can do so, by creating a wiki-link to that page, like so:
|
||||
|
||||
```md
|
||||
[[about]]
|
||||
```
|
||||
|
||||
When you start typing, after writing empty double brackets `[[]]`, Obsidian will suggest all the available pages you can link to, and after you select one it will create the link automatically for you.
|
||||
|
||||
![[obsidian-content-index-add-link.png]]
|
||||
![[obsidian-content-index-add-link-2.png]]
|
||||
|
||||
Now, let's say you want to show people what books you've read and share your reviews and other information on each one. And let's say information on each book should be available at `/books/abc` path on our website. To achieve this, you need to create a folder called `books` in your vault and add all the project-related files in there.
|
||||
|
||||
To create a new folder in Obsidian, click on the "New folder" icon, and give your folder a name:
|
||||
|
||||
![[obsidian-content-add-folder.png]]
|
||||
|
||||
![[obsidian-content-add-folder-2.png]]
|
||||
|
||||
Now, let's write some book reviews. You can do this by right-clicking on the `/books` folder, and selecting "New note" option. Rename the newly created `Untitled.md` file and add some review in it. Then add some other reviews.
|
||||
|
||||
![[obsidian-content-book.png]]
|
||||
|
||||
Ok, now let's make a page that will list all your books reviews - our Bookshelf! It would be nice to have it available under `/books` path on the website, since each of our books will be available under `/books/abc`. To achieve this, we have to create an index page **inside** our `/books` folder, like so:
|
||||
|
||||
![[obsidian-content-book-index.png]]
|
||||
|
||||
Then, let's list our book reviews with wiki-links to their pages:
|
||||
|
||||
![[obsidian-content-book-index-2.png]]
|
||||
|
||||
![[obsidian-content-book-index-3.png]]
|
||||
|
||||
Now, let's add a link to our Bookshelf page on our home page, so that it's easy to find.
|
||||
|
||||
![[obsidian-content-index-bookshelf-link.png]]
|
||||
|
||||
Now, if you want to have your link say something different than the raw `books/index`, you can do this by typing `|` after the path and specifying an alternative name, .e.g:
|
||||
|
||||
```md
|
||||
[[books/index|Bookshelf]]
|
||||
```
|
||||
|
||||
Let's also do this for the about page:
|
||||
|
||||
```md
|
||||
[[about|About me]]
|
||||
```
|
||||
|
||||
![[obsidian-content-index-link-aliases.png]]
|
||||
|
||||
That's better!
|
||||
|
||||
Now, let's maybe add a short info at the bottom, that this site is new and is currently being worked on, in form of an Obsidian callout:
|
||||
|
||||
```md
|
||||
> [!info]
|
||||
> 🚧 This site it pretty new and I'm enhancing it every day. Stay tuned!
|
||||
```
|
||||
|
||||
![[obsidian-content-index-callout.png]]
|
||||
|
||||
Great, our updated site is ready to be published! 🔥
|
||||
|
||||
## Save and publish your changes
|
||||
|
||||
### 1. Navigate to GitHub Desktop app
|
||||
|
||||
In the "Changes" tab, you'll see all the changes that have been made to the repository.
|
||||
|
||||
![[github-desktop-all-changed-files.png]]
|
||||
|
||||
All the new files will have `[+]` sign next to them, and all the edited files will have `[•]`.
|
||||
|
||||
### 2. Commit your changes
|
||||
|
||||
Now, to save these changes we need to "commit" them, which is a fancy term for making a checkpoint of the state at which your repository is currently in.
|
||||
|
||||
Let's make this checkpoint! In the bottom left corner there is a "Summary (required)" field, which is the place for a commit message - a concise description of the changes you made. The "Description" field is optional, and it's only needed if you need to add some more information about your changes that doesn't fit in the commit message.
|
||||
|
||||
![[github-desktop-add-commit-message.png]]
|
||||
|
||||
Now, hit the "Commit to main" button, and done! Now GitHub Desktop should say there are no local changes again. And that's correct, as all the changes we made have successfully been saved, and no other changes have been made since then.
|
||||
|
||||
You should see the last commit message under the button:
|
||||
|
||||
![[github-desktop-commit-message.png]]
|
||||
|
||||
You can also inspect the whole history of past commits in the "History tab".
|
||||
|
||||
![[github-desktop-history.png]]
|
||||
|
||||
The very fist commit on top is the commit we've just made, but you can also see all the commits to the repository we made in [[create-a-website-from-scratch|tutorial 1]], via GitHub UI.
|
||||
|
||||
### 3. Push your changes to the remote repository
|
||||
|
||||
The commit we've just crated has ↑ sign next to it. It means it hasn't yet been pushed to our remote version of the repository - the changes you made has been saved, but only locally on your computer. In order to push them to the cloud copy of the repository (aka "remote"), click "↑ Push origin (1 ↑)" tab.
|
||||
|
||||
When the "push" is complete, the arrow next to the last commit message should disappear, and there should be no `(1 )` indicator next to "Push origin" button.
|
||||
|
||||
![[github-desktop-history-after-push.png]]
|
||||
|
||||
### 4. See updated site live!
|
||||
|
||||
Navigate to your [vercel dashboard](https://vercel.com/dashboard).
|
||||
|
||||
![[vercel-dashboard.png]]
|
||||
|
||||
Click on the project repository to go to its dashboard.
|
||||
|
||||
You may have to wait a bit until the site builds, but once it's ready, you should see the preview with our latest changes.
|
||||
|
||||
![[vercel-project-dashboard.png]]
|
||||
|
||||
Note, that under "SOURCE" section (next to the preview) there is also our last commit message, indicating that the latest deployment has been triggered by this commit.
|
||||
|
||||
Click on the preview to see the updated site live!
|
||||
|
||||
![[tutorial-2-result.png]]
|
||||
![[live-book-home-page.png]]
|
||||
![[live-book.png]]
|
||||
|
||||
Congratulations!
|
||||
|
||||
You have successfully completed the tutorial on editing your Flowershow website locally on your computer. By utilising Obsidian and GitHub Desktop, you have unlocked powerful editing capabilities and improved the overall publishing process. Now, you can enjoy the benefits of offline editing, simultaneous file editing, and previewing the extended Markdown syntax provided by Obsidian.
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
title: 'Enhancing Geospatial Data Visualization with PortalJS'
|
||||
date: 2023-07-18
|
||||
authors: ['João Demenech', 'Luccas Mateus', 'Yoana Popova']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
Are you keen on building rich and interactive data portals? Do you find value in the power and flexibility of JavaScript, Nextjs, and React? In that case, allow us to introduce you to [PortalJS](https://portaljs.org/), a state-of-the-art framework leveraging these technologies to help you build amazing data portals.
|
||||
|
||||
Perhaps you already understand that the effective data visualization lies in the adept utilization of various data components. Within [PortalJS](https://portaljs.org/), we take data visualization a step further. It's not just about displaying data - it's about telling a captivating story through the strategic orchestration of a diverse array of data components.
|
||||
|
||||
We are now eager to share our latest enhancement to [PortalJS](https://portaljs.org/): maps, a powerful tool for visualizing geospatial data. In this post, we will to take you on a tour of our experiments and progress in enhancing map functionalities on [PortalJS](https://portaljs.org/). Our journey into this innovative feature is still in its early stages, with new facets being unveiled and refined as we perfect our API. Still, this exciting development opens a new avenue for visualizing data, enhancing your ability to convey complex geospatial information with clarity and precision.
|
||||
|
||||
## Exploring Map Formats
|
||||
|
||||
Maps play a crucial role in geospatial data visualization. Several formats exist for storing and sharing this type of data, with GeoJSON, KML, and shapefiles being among the most popular. As a prominent figure in the field of open-source data portal platforms, [PortalJS](https://portaljs.org/) strives to support as many map formats as possible.
|
||||
|
||||
Taking inspiration from the ckanext-geoview extension, we currently support KML and GeoJSON formats in [PortalJS](https://portaljs.org/). This remarkable extension is a plugin for CKAN, the world’s leading open source data management system, that enables users to visualize geospatial data in diverse formats on an interactive map. Apart from KML and GeoJSON formats support, our roadmap entails extending compatibility to encompass all other formats supported by ckanext-geoview. Rest assured, we are committed to empowering users with a wide array of map format options in the future.
|
||||
|
||||
So, what makes these formats special?
|
||||
|
||||
- **GeoJSON**: This format uses JSON to depict simple geographic features and their associated attributes. It's often hailed as the most popular choice in the field.
|
||||
- **KML**: An XML-based format, KML can store details like placemarks, paths, polygons, and styles.
|
||||
- **Shapefiles**: These are file collections that store vector data—points, lines, and polygons—and their attributes.
|
||||
|
||||
## Unveiling the Power of Leaflet and OpenLayers
|
||||
|
||||
To display maps in [PortalJS](https://portaljs.org/), we utilize two powerful JavaScript libraries for creating interactive maps based on different layers: Leaflet and OpenLayers. Each offers distinct advantages (and disadvantages), inspiring us to integrate both and give users the flexibility to choose.
|
||||
|
||||
Leaflet is the leading open-source JavaScript library known for its mobile-friendly, interactive maps. With its compact size (just 42 KB of JS), it provides all the map features most developers need. Leaflet is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms.
|
||||
|
||||
OpenLayers is a high-performance library packed with features for creating interactive web maps. OpenLayers can display map tiles, vector data, and markers sourced from anywhere on any webpage. It's an excellent tool for leveraging geographic information of all kinds.
|
||||
|
||||
## Introducing Map Feature
|
||||
|
||||
Both components have some similar features and props, such as:
|
||||
|
||||
### Polygons and points
|
||||
|
||||

|
||||
|
||||
Our initial version enables the use of both vectors and points to display information. Points are simpler and faster to render than vectors, but they have less detail and interactivity. For example, if you have data that is represented by coordinates or addresses, you can use points to show them on the map. This way, you can avoid time-consuming loading and rendering complex vector shapes that may slow down your map.
|
||||
|
||||
### Tooltips
|
||||
|
||||

|
||||
|
||||
We have implemented an exciting feature that enhances the usability of our map component: tooltips. When you hover over a polygon or point on the map, a small pop-up window, known as a tooltip, appears. This tooltip provides relevant details about the feature under your cursor, according to what features the map creator wants to highlight. For example, when exploring countries, you can effortlessly discover their name, population, and area by hovering over them. Similarly, hovering over cities reveals useful information like their name, temperature, and elevation. To enable this handy tooltip functionality on our map, simply include a tooltip prop when using the map component.
|
||||
|
||||
### Focus
|
||||
|
||||

|
||||
|
||||
Users can also choose a region of focus, which will depend on the data, by setting initial center coordinates and zoom level. This is especially helpful for maps that are not global, such as the ones that use data from a specific country, city or region.
|
||||
|
||||
## Mapping the Future with PortalJS
|
||||
|
||||
Through our ongoing enhancements to the [PortalJS library](https://storybook.portaljs.org/), we aim to empower users to create engaging and informative data portals featuring diverse map formats and data components.
|
||||
|
||||
Why not give [PortalJS](https://portaljs.org/) a try today and discover the possibilities for your own data portals? To get started, check out our comprehensive documentation here: [PortalJS Documentation](https://portaljs.org/docs).
|
||||
|
||||
Have questions or comments about using [PortalJS](https://portaljs.org/) for your data portals? Feel free to share your thoughts on our [Discord channel](https://discord.com/invite/EeyfGrGu4U). We're here to help you make the most of your data.
|
||||
|
||||
Stay tuned for more exciting developments as we continue to enhance [PortalJS](https://portaljs.org/)!
|
||||
@@ -264,7 +264,7 @@ The above script will output the following to the terminal:
|
||||
|
||||
## Done!
|
||||
|
||||
That's it! We've just created a simple catalog of our GitHub projects using markdown files and the MarkdownDB package. You can find the [full code for this tutorial here](https://github.com/datopian/markdowndb/tree/main/examples/basic-example).
|
||||
That's it! We've just created a simple catalog of our GitHub projects using markdown files and the MarkdownDB package. You can find the full code for this tutorial [here](https://github.com/datopian/markdowndb/tree/main/examples/basic-example).
|
||||
|
||||
We look forward to seeing the amazing applications you'll build with this tool!
|
||||
|
||||
|
||||
@@ -1,72 +1,61 @@
|
||||
const config = {
|
||||
title: 'PortalJS - The JavaScript framework for data portals.',
|
||||
title:
|
||||
"PortalJS",
|
||||
description:
|
||||
'PortalJS is a JavaScript framework for rapidly building rich data portal frontends using a modern frontend approach.',
|
||||
"PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog/portal.",
|
||||
theme: {
|
||||
default: 'dark',
|
||||
toggleIcon: '/images/theme-button.svg',
|
||||
default: "dark",
|
||||
toggleIcon: "/images/theme-button.svg",
|
||||
},
|
||||
author: 'Datopian',
|
||||
authorLogo: '/datopian-logo.webp',
|
||||
authorUrl: 'https://datopian.com/',
|
||||
author: "Datopian",
|
||||
authorLogo: "/datopian-logo.png",
|
||||
authorUrl: "https://datopian.com/",
|
||||
navbarTitle: {
|
||||
// logo: "/images/logo.svg",
|
||||
text: '🌀 PortalJS',
|
||||
text: "🌀 PortalJS",
|
||||
// version: "Alpha",
|
||||
},
|
||||
navLinks: [
|
||||
{ name: 'Docs', href: '/docs' },
|
||||
{ name: "Docs", href: "/docs" },
|
||||
// { name: "Components", href: "/docs/components" },
|
||||
{ name: 'Blog', href: '/blog' },
|
||||
{ name: 'Showcases', href: '/#showcases' },
|
||||
{ name: 'Howtos', href: '/howtos' },
|
||||
{ name: 'Guide', href: '/guide' },
|
||||
{
|
||||
name: 'Examples',
|
||||
href: 'https://github.com/datopian/portaljs/tree/main/examples',
|
||||
target: '_blank',
|
||||
},
|
||||
{
|
||||
name: 'Components',
|
||||
href: 'https://storybook.portaljs.org',
|
||||
target: '_blank',
|
||||
},
|
||||
{ name: "Blog", href: "/blog" },
|
||||
{ name: "Showcases", href: "/#showcases" },
|
||||
{ name: "Howtos", href: "/howtos" },
|
||||
{ name: "Guide", href: "/guide" },
|
||||
{ name: "Examples", href: "https://github.com/datopian/portaljs/tree/main/examples", target: "_blank" },
|
||||
{ name: "Components", href: "https://storybook.portaljs.org", target: "_blank" },
|
||||
// { name: "DL Demo", href: "/data-literate/demo" },
|
||||
// { name: "Excel Viewer", href: "/excel-viewer" },
|
||||
],
|
||||
footerLinks: [],
|
||||
nextSeo: {
|
||||
additionalLinkTags: [
|
||||
{ rel: 'icon', href: '/favicon.ico' },
|
||||
{ rel: 'apple-touch-icon', href: '/icon.png', sizes: '120x120' },
|
||||
],
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
type: "website",
|
||||
title:
|
||||
'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||
"PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
||||
description:
|
||||
'PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog and portal.',
|
||||
locale: 'en_US',
|
||||
"PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog and portal.",
|
||||
locale: "en_US",
|
||||
images: [
|
||||
{
|
||||
url: '/homepage-screenshot.png', // TODO
|
||||
alt: 'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||
url: "/homepage-screenshot.png", // TODO
|
||||
alt: "PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
||||
width: 1280,
|
||||
height: 720,
|
||||
type: 'image/jpg',
|
||||
type: "image/jpg",
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
handle: '@datopian',
|
||||
site: 'https://datopian.com/',
|
||||
cardType: 'summary_large_image',
|
||||
handle: "@datopian",
|
||||
site: "https://datopian.com/",
|
||||
cardType: "summary_large_image",
|
||||
},
|
||||
},
|
||||
github: 'https://github.com/datopian/portaljs',
|
||||
discord: 'https://discord.gg/EeyfGrGu4U',
|
||||
github: "https://github.com/datopian/portaljs",
|
||||
discord: "https://discord.gg/EeyfGrGu4U",
|
||||
tableOfContents: true,
|
||||
analytics: 'G-96GWZHMH57',
|
||||
analytics: "G-96GWZHMH57",
|
||||
// editLinkShow: true,
|
||||
};
|
||||
export default config;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: 'Creating new datasets'
|
||||
description: 'PortalJS Tutorial II - Learn how to create new datasets on a data portal'
|
||||
---
|
||||
<NextSeo title="Creating new datasets - PortalJS" />
|
||||
|
||||
# Creating new datasets
|
||||
|
||||
So far, the PortalJS app we created only has a single page displaying a dataset. Data catalogs and data portals generally showcase many different datasets.
|
||||
|
||||
@@ -11,7 +10,7 @@ Let's explore how to add and display more datasets to our portal.
|
||||
|
||||
As you have seen, in this example a dataset page is just a markdown file on disk plus a data file.
|
||||
|
||||
To create a new data showcase page we just create a new markdown file in the `content/` folder and a new data file in the `public/` folder.
|
||||
To create a new data showcase page we just create a new markdown file in the `content/` folder and a new data file in the `public/` folder.
|
||||
|
||||
Let's do that now. Create a `content/my-incredible-dataset` folder, and inside this new folder create a `index.md` file with the following content:
|
||||
|
||||
@@ -20,7 +19,7 @@ Let's do that now. Create a `content/my-incredible-dataset` folder, and inside t
|
||||
|
||||
This is my incredible dataset.
|
||||
|
||||
## Chart
|
||||
## Chart
|
||||
|
||||
<LineChart
|
||||
title="US Population By Decade"
|
||||
@@ -43,7 +42,7 @@ Year,Population (mi)
|
||||
|
||||
Note that pages are associated with a route based on their pathname, so, to see the new data page, access http://localhost:3000/my-incredible-dataset from the browser. You should see the following:
|
||||
|
||||
<img src="/assets/docs/my-incredible-dataset.png" alt="Page of a new dataset created on a PortalJS data portal" />
|
||||
<img src="/assets/docs/my-incredible-dataset.png" />
|
||||
|
||||
> [!tip]
|
||||
> In this tutorial we opted for storing content as markdown files and data as CSV files in the app, but PortalJS can have metadata, data and content stored anywhere.
|
||||
@@ -59,11 +58,12 @@ List of available datasets:
|
||||
|
||||
- [My Awesome Dataset](/my-awesome-dataset)
|
||||
- [My Incredible Dataset](/my-incredible-dataset)
|
||||
|
||||
```
|
||||
|
||||
From the browser, access http://localhost:3000. You should see the following:
|
||||
|
||||
<img src="/assets/docs/datasets-index-page.png" alt="PortalJS data portal with multiple datasets" />
|
||||
<img src="/assets/docs/datasets-index-page.png" />
|
||||
|
||||
At this point, the app has multiple datasets, and users can find and navigate to any dataset they want. In the next lesson, you are going to learn how to improve this experience with search.
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ Congratulations, your new app is now running at http://localhost:3000.
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fdatopian%2Fportaljs%2Ftree%2Fmain%2Fexamples%2Fgithub-backed-catalog)
|
||||
|
||||
By clicking on this button, you will be redirected to a page which will allow you to clone the example into your own GitHub/GitLab/BitBucket account and automatically deploy it.
|
||||
By clicking on this button, you will be redirected to a page which will allows you to clone the example into your own GitHub/GitLab/BitBucket account and automatically deploy it.
|
||||
|
||||
### GitHub token
|
||||
|
||||
@@ -101,7 +101,7 @@ It has
|
||||
You can also add
|
||||
|
||||
- A `description` which is useful if you have more than one dataset for each repo, if not provided we are just going to use the repo description
|
||||
- A `Name` which is useful if you want to give your dataset a nice name, if not provided we are going to use the junction of the `owner` the `repo` + the path of the README, in the example above it will be `fivethirtyeight/data/nba-raptor`
|
||||
- A `Name` which is useful if you want to give your dataset a nice name, if not provided we are going to use the junction of the `owner` the `repo` + the path of the README, in the exaple above it will be `fivethirtyeight/data/nba-raptor`
|
||||
|
||||
## Extra commands
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: Getting Started
|
||||
description: 'Getting started guide and tutorial about data portal-building with PortalJS'
|
||||
---
|
||||
<NextSeo title="Getting Started - PortalJS" />
|
||||
|
||||
# Getting Started
|
||||
|
||||
Welcome to the PortalJS documentation!
|
||||
|
||||
@@ -39,7 +38,7 @@ Let's check it's working and what we have! Open http://localhost:3000 from your
|
||||
|
||||
You should see a page like this when you access http://localhost:3000. This is the starter template page which shows the most simple data portal you could have: a simple README plus csv file.
|
||||
|
||||
<img src="/assets/examples/basic-example.png" alt="Initial state of the PortalJS tutorial project" />
|
||||
<img src="/assets/examples/basic-example.png" />
|
||||
|
||||
### Editing the Page
|
||||
|
||||
@@ -52,8 +51,8 @@ Let’s try editing the starter page.
|
||||
|
||||
After refreshing the page, you should see the new text:
|
||||
|
||||
<img src="/assets/docs/editing-the-page-1.png" alt="PortalJS tutorial project after a simple change is made by a user" />
|
||||
<img src="/assets/docs/editing-the-page-1.png" />
|
||||
|
||||
Congratulations! The app is up and running and you learned how to edit a page. In the next lesson, you are going to learn how to create new datasets.
|
||||
Congratulations! The app is up and running and you learned how to edit a page. In the next lesson, you are going to learn how to create new datasets.
|
||||
|
||||
<DocsPagination next="/docs/creating-new-datasets" />
|
||||
|
||||
@@ -26,7 +26,7 @@ This example makes use of the [markdowndb](https://github.com/datopian/markdownd
|
||||
|
||||
From the browser, access http://localhost:3000. You should see the following, you now have a searchable automatic list of your datasets:
|
||||
|
||||

|
||||

|
||||
|
||||
To make this catalog look even better, we can change the text that is being displayed for each dataset to a title. Let's do that by adding the "title" [frontmatter field](https://daily-dev-tips.com/posts/what-exactly-is-frontmatter/) to the first dataset in the list. Change `content/my-awesome-dataset/index.md` to the following:
|
||||
|
||||
@@ -46,7 +46,7 @@ Built with PortalJS
|
||||
|
||||
Rerun `npm run mddb` and, from the browser, access http://localhost:3000. You should see the title appearing instead of the folder name:
|
||||
|
||||

|
||||

|
||||
|
||||
Any frontmatter attribute that you add will automatically get indexed and be usable in the search box.
|
||||
|
||||
@@ -102,7 +102,7 @@ List of available datasets:
|
||||
|
||||
You now have a filter in your page with all possible values automatically added to it.
|
||||
|
||||

|
||||

|
||||
|
||||
In the next lesson, you are going to learn how to display metadata on the dataset page.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
If you go now to `http://localhost:3000/my-awesome-dataset`, you will see that we now have two titles on the page. That's because `title` is one of the default metadata fields supported by PortalJS.
|
||||
|
||||

|
||||

|
||||
|
||||
Change the content inside `/content/my-awesome-dataset/index.md` to this.
|
||||
|
||||
@@ -15,7 +15,7 @@ author: 'Rufus Pollock'
|
||||
description: 'An awesome dataset displaying some awesome data'
|
||||
modified: '2023-05-04'
|
||||
files: ['data.csv']
|
||||
group: 'Awesome'
|
||||
groups: ['Awesome']
|
||||
---
|
||||
|
||||
Built with PortalJS
|
||||
@@ -27,7 +27,7 @@ Built with PortalJS
|
||||
|
||||
Once you refresh the page at `http://localhost:3000/my-awesome-dataset` you should see something like this at the top:
|
||||
|
||||

|
||||

|
||||
|
||||
These are the standard metadata fields that will be shown at the top of the page if you add them.
|
||||
|
||||
@@ -35,6 +35,6 @@ These are the standard metadata fields that will be shown at the top of the page
|
||||
- `author`, `description`, and `modified` which gets displayed below the title
|
||||
- `files` that get displayed as a table with two columns: `File` which is linked directly to the file, and `Format` which show the file format.
|
||||
|
||||
Feel free to experiment with these metadata fields. At this point, you might want to deploy the app, and that's what you are going to learn in the next lesson.
|
||||
Feel free to experiment with these metadata fields. At this point, you might want to deploy the app, and that's what you are going to learn in the next lesson.
|
||||
|
||||
<DocsPagination prev="/docs/searching-datasets" next="/docs/deploying-your-portaljs-app" />
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
---
|
||||
showToc: false
|
||||
showSidebar: false
|
||||
title: 'Markdown-based Websites Guide'
|
||||
disableTitle: true
|
||||
description: Create markdown-based websites and data portals, update it, add collaborators and discover markdown superpowers with Flowershow and PortalJS
|
||||
---
|
||||
|
||||
<Hero title="Markdown-based Websites" subtitle="Create markdown-based website, update it, add collaborators and discover markdown superpowers" />
|
||||
|
||||
## Tutorials
|
||||
|
||||
### Tutorial 1: Create a website from scratch using markdown and PortalJS
|
||||
# Tutorial 1: Create a website from scratch using markdown and PortalJS
|
||||
|
||||
In this tutorial we will walk you through creating an elegant, fully functional website written in simple markdown and published with PortalJS.
|
||||
|
||||
@@ -22,7 +17,7 @@ By the end of this tutorial you will:
|
||||
Below is a screenshot of how the final website will look like:
|
||||
![[tutorial-1-result.png]]
|
||||
|
||||
#### Setup a sandbox website including live publishing
|
||||
### Setup a sandbox website including live publishing
|
||||
|
||||
- Prerequisites: sign up for GitHub and Vercel
|
||||
- Navigate to [datopian/flowershow repository](https://github.com/datopian/flowershow)
|
||||
@@ -30,14 +25,14 @@ Below is a screenshot of how the final website will look like:
|
||||
- Let the site build on Vercel
|
||||
- Visit the site! Yay! Your site is working! 🎉
|
||||
|
||||
#### Now, let's edit the front page
|
||||
### Now, let's edit the front page
|
||||
|
||||
- Navigate to `content/index.md` file in the site repository
|
||||
- Add some text to it
|
||||
- Save and watch the site redeploy
|
||||
- Visit the site! Yay! Your changes are live! 🎉
|
||||
|
||||
#### Let's add a page: e.g. about page
|
||||
### Let's add a page: e.g. about page
|
||||
|
||||
- Navigate to the `content` folder in the site repository
|
||||
- Add `about.md` file with some text
|
||||
@@ -47,150 +42,16 @@ Below is a screenshot of how the final website will look like:
|
||||
> [!tip]
|
||||
> Read full tutorial [[create-a-website-from-scratch|here!]]
|
||||
|
||||
### Tutorial 2: Editing your site locally on your computer
|
||||
# Tutorial 2: Editing your site locally on your computer
|
||||
|
||||
In this tutorial, we will walk you through the process of editing your Flowershow website locally on your computer.
|
||||
### What is this markdown stuff?
|
||||
|
||||
By the end of this tutorial, you will:
|
||||
- Idea of "markup" - how is this different from plain text
|
||||
- Brief info about markdown
|
||||
- Link to markdown tutorials
|
||||
- Explain we offer "markdown plus"
|
||||
- ?? Explain about PFM (vs GFM ...)
|
||||
|
||||
- Understand what is Markdown and why you should use Obsidian to edit content on your Flowershow websites in most cases.
|
||||
- Gain a deeper understanding of working with Git and GitHub Desktop.
|
||||
- Learn how to clone your website's repository to your computer.
|
||||
- Learn how to edit content using Obsidian and what are the benefits of it.
|
||||
- Learn how to commit (save) your changes locally and push them back to the GitHub repository.
|
||||
### Why go local?
|
||||
|
||||
Below is a screenshot of how the final website will look like:
|
||||
|
||||
![[tutorial-2-result.png]]
|
||||
|
||||
#### Clone the repository to your computer
|
||||
|
||||
- Setup GitHub Desktop app with your GitHub account
|
||||
- Grab your site's repository URL
|
||||
- Open GitHub Desktop app and clone the repository
|
||||
- Yay! You have a copy of your website's repository on your computer! 🎉
|
||||
|
||||
#### Now, let's edit in Obsidian
|
||||
|
||||
- Open the `/content` folder of the cloned repository in Obsidian
|
||||
- Edit the home page and the about page
|
||||
- Create a folder with the reviews of books you've read
|
||||
|
||||
#### Commit your changes
|
||||
|
||||
- Commit the changes in GitHub Desktop app
|
||||
- Push the changes to the remote repository
|
||||
- Watch the site redeploy
|
||||
- Visit the site! Yay! Your changes are live! 🎉
|
||||
|
||||
> [!tip]
|
||||
> Read full tutorial [[edit-a-website-locally|here!]]
|
||||
|
||||
### Tutorial 3: Collaborating with others on your website project
|
||||
|
||||
In this tutorial, we will guide you through collaborating with others on the same website project using GitHub.
|
||||
|
||||
By the end of this tutorial, you will:
|
||||
|
||||
- Understand what a branch is and how to create one.
|
||||
- Understand what a pull request (PR) is and how to create one.
|
||||
- Learn how to review and merge a PR.
|
||||
- Know how to resolve conflicts if they arise.
|
||||
- Collaborate with others using GitHub, following best practices.
|
||||
|
||||
#### Create a new branch
|
||||
|
||||
- Navigate to your site's repository on GitHub
|
||||
- Click on the 'Branch' dropdown menu, type a new branch name and press Enter
|
||||
- Yay! You've created a new branch! 🎉
|
||||
|
||||
#### Now, let's make changes in the new branch
|
||||
|
||||
- Switch to the new branch in GitHub Desktop
|
||||
- Open the `/content` folder of the repository in Obsidian
|
||||
- Edit the `about` page
|
||||
- Commit the changes in GitHub Desktop app and push them to the remote repository on GitHub
|
||||
|
||||
#### Create a pull request (PR)
|
||||
|
||||
- Go back to your site's repository on GitHub
|
||||
- Click on 'New pull request'
|
||||
- Select your branch from the dropdown menu
|
||||
- Write a brief description of your changes, then click on 'Create pull request'
|
||||
- Yay! Your changes are ready to be reviewed! 🎉
|
||||
|
||||
#### Review and merge a pull request
|
||||
|
||||
- Navigate to the 'Pull requests' tab in your repository
|
||||
- Open the newly created pull request
|
||||
- Review the changes, add comments if necessary
|
||||
- If everything is in order, click 'Merge pull request', then 'Confirm merge'
|
||||
- Yay! You've merged your changes into the main branch! 🎉
|
||||
|
||||
#### Resolving conflicts
|
||||
|
||||
- In case of conflicts between your changes and those on the main branch, GitHub will alert you
|
||||
- Follow the on-screen instructions to resolve the conflicts and merge your changes
|
||||
|
||||
> [!tip]
|
||||
> Read full tutorial [[collaborate-on-website-project|here!]] (TBD)
|
||||
|
||||
### Tutorial 4: Customising your website locally and previewing your changes locally
|
||||
|
||||
In this tutorial, we will dive into the more technical aspects of website customisation, but this time, everything will be done locally. You'll learn how to preview your site on your own machine before pushing changes to the live site, ensuring everything looks and works exactly as you want.
|
||||
|
||||
By the end of this tutorial, you will:
|
||||
|
||||
- Understand how to preview your site locally.
|
||||
- Know how to change your website's title and description.
|
||||
- Learn how to customise your website's appearance using Tailwind themes.
|
||||
- Understand how to configure the navbar, navigation links, and logo.
|
||||
- Learn how to integrate Google Analytics into your website.
|
||||
- Be aware of additional customisation options for deeper customisation.
|
||||
|
||||
#### Previewing the site locally
|
||||
|
||||
- Navigate to your website's repository directory on your computer using command line
|
||||
- Install the site's dependencies
|
||||
- Start the local development server
|
||||
- Visit the local address displayed in your command line. Yay! You can now preview your changes locally, live! 🎉
|
||||
|
||||
#### Changing the site title and description
|
||||
|
||||
- Perfect! You've personalised your site's title and description! 🎉
|
||||
|
||||
#### Configuring the title, description and navbar
|
||||
|
||||
- Open the `content/config.mjs` file in your code editor
|
||||
- Edit the `title` and `description` fields
|
||||
- Edit the fields in the `navbar` field to customise your navbar's title and logo. Then, add navigation links to `navLinks` field (these will be displayed in the navbar). Save and refresh your local site to see the changes.
|
||||
|
||||
#### Integrating with Google Analytics
|
||||
|
||||
- Still in the `content/config.mjs` file, navigate to the `analytics` field
|
||||
- Enter your Google Analytics tracking ID, save and refresh your local site to ensure it's integrated correctly
|
||||
- Excellent! Your website is now integrated with Google Analytics! 🎉
|
||||
|
||||
#### Customising the Tailwind theme
|
||||
|
||||
- Open `tailwind.config.js` file in your code editor
|
||||
- Change the light and dark theme colours and fonts to your liking, save and refresh your local site to see the changes
|
||||
- Awesome! Your website now has a new look! 🎉
|
||||
|
||||
When you're happy with all your changes, use GitHub Desktop to commit your changes and push them back to your GitHub repository.
|
||||
|
||||
In addition to these topics, the full tutorial shows you what other customisations options are available and where to find information on these.
|
||||
|
||||
> [!tip]
|
||||
> Read full tutorial here! (TBD)
|
||||
|
||||
|
||||
## Howtos
|
||||
|
||||
- [[quickly-create-a-sandbox-website|How to quickly create a sandbox website]]
|
||||
- [[edit-text-on-a-single-md-page|How to quickly edit text on a single Markdown-based page]]
|
||||
- [[add-a-simple-md-page|How to add a simple Markdown page]]
|
||||
- [[edit-or-add-md-pages-locally|How to edit or add Markdown-based pages locally on your computer]]
|
||||
- [[how-to-add-images-to-a-md-page|How to add images to a Markdown-based page]]
|
||||
- [[publish-obsidian-vault-to-github|How to push an Obsidian vault to a GitHub repository]]
|
||||
- [[create-a-simple-catalog-of-anything|How to create a simple catalog of anything in Obsidian]]
|
||||
While editing on GitHub UI is acceptable, it has its limitations – it doesn't support working offline, adding multiple files simultaneously, or previewing many markdown syntax elements supported by Flowershow-based websites.
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
---
|
||||
title: How to quickly add a simple Markdown-based page
|
||||
date: 2023-07-27
|
||||
authors: ['Lauren Wigmore', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
Welcome to this howto on how to quickly add a simple Markdown-based page to your website. The steps here are designed for non-technical contributors. There's no need to know how to code!
|
||||
Welcome to this tutorial on how to quickly add a simple Markdown-based page to your website. The steps here are designed for non-technical contributors. There's no need to know how to code!
|
||||
|
||||
> [!important]
|
||||
> This "How to" is only recommended for very simple Markdown pages, e.g. those without images, links to other pages, diagrams, or other elements that can't be previewed in GitHub preview mode.
|
||||
> This "How to" is only recommended for very simple Markdown pages, e.g. those without images, links to other pages, diagrams, or other elements that can't be previewed in GitHub preview mode.
|
||||
|
||||
> [!tip]
|
||||
>[!tip]
|
||||
> If you are unfamiliar with Markdown (and its different flavours and extra elements supported by Flowershow based websites), check out [this short guide](https://flowershow.app/docs/syntax) on available syntax elements.
|
||||
|
||||
## Steps
|
||||
@@ -23,15 +20,15 @@ Welcome to this howto on how to quickly add a simple Markdown-based page to your
|
||||
> [!tip]
|
||||
> If you want to add your page to a new subfolder, in the "Name your file..." field, first type the name of the new subfolder, followed by a forward slash, .e.g., `blog/`. After you hit the slash, you'll see the name field gets cleared, but the path before it has been extended with your subfolder name. You can repeat this process if you want to put your file into further nested subfolders. Then, simply type the name of the file with ".md" extension.
|
||||
|
||||
5. Paste or write the contents of the file in Markdown format.
|
||||
5. Paste or write the contents of the file in Markdown format.
|
||||
6. (Optionally) Switch to the "Preview" mode, by toggling from "Edit" -> "Preview" at the top of the file content, to see a rough visualisation of your changes. Keep in mind though, that the actual website may have different styling and may support additional Markdown elements that GitHub doesn't render on the preview.
|
||||
7. When you're happy with the content, click on the “Commit changes...” button. In the "Commit message" field, provide a concise summary of your changes. If necessary, you can add further explanation in the "Extended description" text field. Then select “Commit directly to the main branch”, and hit "Commit changes."
|
||||
8. The site is now going to be rebuilt to reflect the changes saved to the `main` branch. This can take up to a few minutes. After this time you should see your page live.
|
||||
5. When you're happy with the content, click on the “Commit changes...” button. In the "Commit message" field, provide a concise summary of your changes. If necessary, you can add further explanation in the "Extended description" text field. Then select “Commit directly to the main branch”, and hit "Commit changes."
|
||||
6. The site is now going to be rebuilt to reflect the changes saved to the `main` branch. This can take up to a few minutes. After this time you should see your page live.
|
||||
|
||||
## Summary
|
||||
|
||||
Congratulations, you've now learned how to create a new Markdown page on your Flowershow-based website.
|
||||
Congratulations, you've now learned how to create a new Markdown page on your Flowershow-based website.
|
||||
|
||||
If anything is not clear to you, or you have suggestions on how we can make this 'How to' better, please don't hesitate to let us know.
|
||||
If anything is not clear to you, or you have suggestions on how we can make this 'How to' better, please don't hesitate to let us know.
|
||||
|
||||
Happy editing!
|
||||
|
||||
@@ -3,6 +3,13 @@ title: How to add or edit content on the Life Itself ecosystem page
|
||||
isDraft: true
|
||||
---
|
||||
|
||||
## Contents
|
||||
|
||||
1. [Introduction](#introduction)
|
||||
2. [How to edit and add to the site](#how-to-edit-and-add-to-the-site)
|
||||
3. [Glossary](#glossary)
|
||||
4. [Contact](#contact)
|
||||
|
||||
## Introduction
|
||||
|
||||
From the outset, we have argued that any successful mapping effort must be collaborative and participatory. To make it as simple as possible to contribute, we have opened up the site, giving it a wiki-like structure, meaning people can contribute and add items directly - no coding required. We hope this can support the ongoing growth of our contributor community, and empower users to continue in collective efforts to make the map ever more useful and informative.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to add Google Analytics?
|
||||
description: Learn to implement Google Analytics on PortalJS data portals
|
||||
---
|
||||
# How to add Google Analytics?
|
||||
|
||||
>[!todo] Prerequisites
|
||||
>- [Google Analytics account](https://support.google.com/analytics/answer/9304153?hl=en)
|
||||
@@ -77,4 +74,4 @@ export default function MyApp({ Component, pageProps }) {
|
||||
```
|
||||
|
||||
>[!info]
|
||||
> For more info on measuring pageviews with Google Analytics see [Google Analytics documentation](https://developers.google.com/analytics/devguides/collection/gtagjs/pages).
|
||||
> For more info on measuring pageviews with Google Analytics see [Google Analytics documentation](https://developers.google.com/analytics/devguides/collection/gtagjs/pages).
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to add a simple blog?
|
||||
description: How to add a simple blog on a PortalJS data portal
|
||||
---
|
||||
# How to add a simple blog?
|
||||
|
||||
## Setup
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to add user comments?
|
||||
description: Learn how to add user comments on a PortalJS data portal
|
||||
---
|
||||
# How to add user comments?
|
||||
|
||||
![[comments-example.png]]
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to create data-rich documents with charts and tables?
|
||||
description: Learn how to create a data-rich document with charts and tables on a PortalJS data portal
|
||||
---
|
||||
# How to create data-rich documents with charts and tables?
|
||||
|
||||
> [!info] Prerequisites
|
||||
> If you want to enrich your markdown content with charts and tables, you first need to add support for rendering markdown files in your PortalJS app. Follow [[markdown|this guide]] to learn how to do this.
|
||||
@@ -18,12 +15,12 @@ Now, in order to use these components in your markdown files, we need to pass th
|
||||
|
||||
```tsx
|
||||
// e.g. /blog/[[...slug]].tsx
|
||||
import fs from 'fs';
|
||||
import { LineChart, Table, Catalog, Vega, VegaLite } from '@portaljs/components';
|
||||
import fs from "fs";
|
||||
import { LineChart, Table, Catalog, Vega, VegaLite } from "@portaljs/components";
|
||||
|
||||
import { MdxRemote } from 'next-mdx-remote';
|
||||
import clientPromise from '@/lib/mddb.mjs';
|
||||
import parse from '@/lib/markdown';
|
||||
import { MdxRemote } from "next-mdx-remote";
|
||||
import clientPromise from "@/lib/mddb.mjs";
|
||||
import parse from "@/lib/markdown";
|
||||
|
||||
const components = {
|
||||
Table: Table,
|
||||
@@ -32,35 +29,37 @@ const components = {
|
||||
LineChart: LineChart,
|
||||
};
|
||||
|
||||
export default function Page({ source }) {
|
||||
source = JSON.parse(source);
|
||||
|
||||
return (
|
||||
<>
|
||||
<MdxRemote source={source} components={components} />
|
||||
</>
|
||||
);
|
||||
export default function Page({ source }) {
|
||||
source = JSON.parse(source);
|
||||
|
||||
return (
|
||||
<>
|
||||
<MdxRemote source={source} components={components} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Import metadata of a file matching the static path and return its parsed source and frontmatter object
|
||||
export const getStaticProps = async ({ params }) => {
|
||||
const urlPath = params?.slug ? (params.slug as string[]).join('/') : '/';
|
||||
const urlPath = params?.slug ? (params.slug as string[]).join("/") : "/";
|
||||
|
||||
const mddb = await clientPromise;
|
||||
const dbFile = await mddb.getFileByUrl(urlPath);
|
||||
const filePath = dbFile!.file_path;
|
||||
// const frontMatter = dbFile!.metadata ?? {};
|
||||
const mddb = await clientPromise;
|
||||
const dbFile = await mddb.getFileByUrl(urlPath);
|
||||
const filePath = dbFile!.file_path;
|
||||
// const frontMatter = dbFile!.metadata ?? {};
|
||||
|
||||
const source = fs.readFileSync(filePath, { encoding: 'utf-8' });
|
||||
const { mdxSource } = await parse(source, 'mdx', {});
|
||||
const source = fs.readFileSync(filePath, { encoding: "utf-8" });
|
||||
const { mdxSource } = await parse(source, "mdx", {});
|
||||
|
||||
return {
|
||||
props: {
|
||||
source: JSON.stringify(mdxSource),
|
||||
// frontMatter
|
||||
},
|
||||
};
|
||||
return {
|
||||
props: {
|
||||
source: JSON.stringify(mdxSource),
|
||||
// frontMatter
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
You can now use these components in your markdown, like so:
|
||||
@@ -94,39 +93,39 @@ Example usage:
|
||||
cols={[
|
||||
{
|
||||
key: 'id',
|
||||
name: 'ID',
|
||||
name: 'ID'
|
||||
},
|
||||
{
|
||||
key: 'firstName',
|
||||
name: 'First name',
|
||||
name: 'First name'
|
||||
},
|
||||
{
|
||||
key: 'lastName',
|
||||
name: 'Last name',
|
||||
name: 'Last name'
|
||||
},
|
||||
{
|
||||
key: 'age',
|
||||
name: 'Age',
|
||||
},
|
||||
name: 'Age'
|
||||
}
|
||||
]}
|
||||
data={[
|
||||
{
|
||||
age: 35,
|
||||
firstName: 'Jon',
|
||||
id: 1,
|
||||
lastName: 'Snow',
|
||||
lastName: 'Snow'
|
||||
},
|
||||
{
|
||||
age: 42,
|
||||
firstName: 'Cersei',
|
||||
id: 2,
|
||||
lastName: 'Lannister',
|
||||
},
|
||||
lastName: 'Lannister'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
```
|
||||
|
||||
> [!info]
|
||||
>[!info]
|
||||
> More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-table--docs)
|
||||
|
||||
### Linechart
|
||||
@@ -140,16 +139,31 @@ Example usage:
|
||||
```js
|
||||
<LineChart
|
||||
data={[
|
||||
['1850', -0.41765878],
|
||||
['1851', -0.2333498],
|
||||
['1852', -0.22939907],
|
||||
['1853', -0.27035445],
|
||||
['1854', -0.29163003],
|
||||
[
|
||||
'1850',
|
||||
-0.41765878
|
||||
],
|
||||
[
|
||||
'1851',
|
||||
-0.2333498
|
||||
],
|
||||
[
|
||||
'1852',
|
||||
-0.22939907
|
||||
],
|
||||
[
|
||||
'1853',
|
||||
-0.27035445
|
||||
],
|
||||
[
|
||||
'1854',
|
||||
-0.29163003
|
||||
]
|
||||
]}
|
||||
/>
|
||||
/>
|
||||
```
|
||||
|
||||
> [!info]
|
||||
>[!info]
|
||||
> More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-linechart--docs)
|
||||
|
||||
### Vega chart
|
||||
@@ -165,30 +179,30 @@ Example usage:
|
||||
table: [
|
||||
{
|
||||
x: 1850,
|
||||
y: -0.418,
|
||||
y: -0.418
|
||||
},
|
||||
{
|
||||
x: 2020,
|
||||
y: 0.923,
|
||||
},
|
||||
],
|
||||
y: 0.923
|
||||
}
|
||||
]
|
||||
}}
|
||||
spec={{
|
||||
$schema: 'https://vega.github.io/schema/vega-lite/v4.json',
|
||||
data: {
|
||||
name: 'table',
|
||||
name: 'table'
|
||||
},
|
||||
encoding: {
|
||||
x: {
|
||||
field: 'x',
|
||||
type: 'ordinal',
|
||||
type: 'ordinal'
|
||||
},
|
||||
y: {
|
||||
field: 'y',
|
||||
type: 'quantitative',
|
||||
},
|
||||
type: 'quantitative'
|
||||
}
|
||||
},
|
||||
mark: 'bar',
|
||||
mark: 'bar'
|
||||
}}
|
||||
/>
|
||||
```
|
||||
@@ -208,35 +222,35 @@ Example usage:
|
||||
table: [
|
||||
{
|
||||
x: 1850,
|
||||
y: -0.418,
|
||||
y: -0.418
|
||||
},
|
||||
{
|
||||
x: 2020,
|
||||
y: 0.923,
|
||||
},
|
||||
],
|
||||
y: 0.923
|
||||
}
|
||||
]
|
||||
}}
|
||||
spec={{
|
||||
$schema: 'https://vega.github.io/schema/vega-lite/v4.json',
|
||||
data: {
|
||||
name: 'table',
|
||||
name: 'table'
|
||||
},
|
||||
encoding: {
|
||||
x: {
|
||||
field: 'x',
|
||||
type: 'ordinal',
|
||||
type: 'ordinal'
|
||||
},
|
||||
y: {
|
||||
field: 'y',
|
||||
type: 'quantitative',
|
||||
},
|
||||
type: 'quantitative'
|
||||
}
|
||||
},
|
||||
mark: 'bar',
|
||||
mark: 'bar'
|
||||
}}
|
||||
/>
|
||||
```
|
||||
|
||||
> [!info]
|
||||
>[!info]
|
||||
> More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vegalite--docs)
|
||||
|
||||
### Catalog
|
||||
@@ -255,21 +269,28 @@ Example usage:
|
||||
metadata: {
|
||||
'details-of-task': 'Detect and categorise abusive language in social media data',
|
||||
language: 'Albanian',
|
||||
'level-of-annotation': ['Posts'],
|
||||
'level-of-annotation': [
|
||||
'Posts'
|
||||
],
|
||||
'link-to-data': 'https://doi.org/10.6084/m9.figshare.19333298.v1',
|
||||
'link-to-publication': 'https://arxiv.org/abs/2107.13592',
|
||||
medium: ['Text'],
|
||||
medium: [
|
||||
'Text'
|
||||
],
|
||||
'percentage-abusive': 13.2,
|
||||
platform: ['Instagram', 'Youtube'],
|
||||
platform: [
|
||||
'Instagram',
|
||||
'Youtube'
|
||||
],
|
||||
reference: 'Nurce, E., Keci, J., Derczynski, L., 2021. Detecting Abusive Albanian. arXiv:2107.13592',
|
||||
'size-of-dataset': 11874,
|
||||
'task-description': 'Hierarchical (offensive/not; untargeted/targeted; person/group/other)',
|
||||
title: 'Detecting Abusive Albanian',
|
||||
title: 'Detecting Abusive Albanian'
|
||||
},
|
||||
url_path: 'dataset-4',
|
||||
url_path: 'dataset-4'
|
||||
},
|
||||
]}
|
||||
/>
|
||||
/>
|
||||
```
|
||||
|
||||
You can also add facets that are going to act as filters for your metadata.
|
||||
@@ -284,23 +305,30 @@ You can also add facets that are going to act as filters for your metadata.
|
||||
metadata: {
|
||||
'details-of-task': 'Detect and categorise abusive language in social media data',
|
||||
language: 'Albanian',
|
||||
'level-of-annotation': ['Posts'],
|
||||
'level-of-annotation': [
|
||||
'Posts'
|
||||
],
|
||||
'link-to-data': 'https://doi.org/10.6084/m9.figshare.19333298.v1',
|
||||
'link-to-publication': 'https://arxiv.org/abs/2107.13592',
|
||||
medium: ['Text'],
|
||||
medium: [
|
||||
'Text'
|
||||
],
|
||||
'percentage-abusive': 13.2,
|
||||
platform: ['Instagram', 'Youtube'],
|
||||
platform: [
|
||||
'Instagram',
|
||||
'Youtube'
|
||||
],
|
||||
reference: 'Nurce, E., Keci, J., Derczynski, L., 2021. Detecting Abusive Albanian. arXiv:2107.13592',
|
||||
'size-of-dataset': 11874,
|
||||
'task-description': 'Hierarchical (offensive/not; untargeted/targeted; person/group/other)',
|
||||
title: 'Detecting Abusive Albanian',
|
||||
title: 'Detecting Abusive Albanian'
|
||||
},
|
||||
url_path: 'dataset-4',
|
||||
url_path: 'dataset-4'
|
||||
},
|
||||
]}
|
||||
facets={['platform', 'language']}
|
||||
/>
|
||||
/>
|
||||
```
|
||||
|
||||
> [!info]
|
||||
|
||||
>[!info]
|
||||
> More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-catalog--docs)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: 'How to edit a page with a code editor or Obsidian'
|
||||
date: 2023-07-27
|
||||
authors: ['Jake Hirsch', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
title: "How to edit a page with a code editor or Obsidian"
|
||||
isDraft: true
|
||||
---
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: How to edit or add Markdown-based pages locally on your computer
|
||||
date: 2023-07-27
|
||||
authors: ['Jake Hirsch', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
## Intro
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
---
|
||||
title: How to quickly edit text on a single Markdown-based page
|
||||
date: 2023-07-27
|
||||
authors: ['Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
title: How to quickly edit text content on a single Markdown-based page
|
||||
---
|
||||
|
||||
Welcome to this tutorial on how to quickly edit text content on a single Markdown-based page. The steps here are designed for non-technical contributors. There's no need to know how to code!
|
||||
Welcome to this tutorial on how to quickly edit text content on a single Markdown-based page. The steps here are designed for non-technical contributors. There's no need to know how to code!
|
||||
|
||||
> [!important]
|
||||
> This "How to" is only recommended for text changes only, e.g. those that don't include adding images, links to other pages, diagrams, or other elements that can't be previewed in GitHub preview mode.
|
||||
> This "How to" is only recommended for text changes only, e.g. those that don't include adding images, links to other pages, diagrams, or other elements that can't be previewed in GitHub preview mode.
|
||||
|
||||
> [!tip]
|
||||
>[!tip]
|
||||
> If you are unfamiliar with Markdown (and its different flavours and extra elements supported by Flowershow based websites), check out [this short guide](https://flowershow.app/docs/syntax) on available syntax elements.
|
||||
|
||||
## Steps
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: How to add images to a Markdown-based page
|
||||
date: 2023-07-27
|
||||
authors: ['Jake Hirsch', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
## Intro
|
||||
|
||||
Here, you will learn how to add images to a Markdown-based page. These instructions show how to add these images locally, on your computer, so first you need to know how to work locally with GitHub Desktop app and Obsidian. If you're new to these tools, we recommend reading this howto first:
|
||||
|
||||
- [[blog/edit-or-add-md-pages-locally|How to edit or add Markdown pages locally]]
|
||||
|
||||
Or you can follow these two tutorials to start from scratch:
|
||||
|
||||
- [[create-a-website-from-scratch|Tutorial 1: Create a Markdown based website from scratch]]
|
||||
- [[edit-a-website-locally|Tutorial 2: Edit your website locally on your computer]]
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A GitHub account
|
||||
- A GitHub Desktop app
|
||||
- Obsidian
|
||||
|
||||
## Steps
|
||||
|
||||
### Step 1: Set the assets folder as an attachment folder
|
||||
|
||||
In Obsidian, in the root of your vault, create a new folder called 'assets'. Then, right click on and select "set as attachment folder". By doing so, all the images you paste into your note will automatically be saved to this folder (instead of being saved to the root, next to all your notes). This is necessary for your website to display embedded images.
|
||||
|
||||
### Step 2: Copy and paste your image
|
||||
|
||||
Copy whichever image you would like to add and paste it directly into your Obsidian note. You can check that it has been saved to the "assets" folder.
|
||||
|
||||
### Step 3: Commit and push
|
||||
|
||||
To learn more about this step, see the howto or the tutorials listed in the intro section.
|
||||
|
||||
## Summary
|
||||
|
||||
Congratulations, you've now learned how to add an image to your Markdown page!
|
||||
|
||||
If anything is not clear to you, or you have suggestions on how we can make this 'How to' better, please don't hesitate to let us know.
|
||||
|
||||
Happy editing!
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
title: How to format a perfect Markdown-based page
|
||||
date: 2023-07-27
|
||||
authors: ['Lauren Wigmore', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
isDraft: true
|
||||
---
|
||||
|
||||
Welcome to this information guide to help you understand how to format the perfect Markdown-based page for your website. The information here is designed to give you an overview.
|
||||
|
||||
## Types of Markdown Styles
|
||||
|
||||
There are three types of Markdown options that are supported by Flowershow.
|
||||
|
||||
- CommonMark
|
||||
- GitHub Flavored Markdown (GFM) - a superset of CommonMark
|
||||
- Obsidian Flavored Markdown - a superset of CommonMark with most GFM functionalities plus its own syntax elements, such as wikilinks, callouts, LaTeX, mermaid diagrams, and more.
|
||||
|
||||
Each one has extra functionalities building on top of the previous Markdown option.
|
||||
|
||||
Flowershow aims to be fully Obsidian compatible since it supports most Obsidian Flavored Markdown syntax elements and therefore, it is the best to use as an editor.
|
||||
|
||||
## Useful Links
|
||||
|
||||
It would be too complicated (and long) to explain all of the formatting aspects here, so we have included the links below to provide you with this information and more!
|
||||
[Flowershow Documents Page](https://flowershow.app/docs/syntax) - Use this page to see all of the useful key elements that are frequently required on Flowershow pages.
|
||||
[Obsidian help pages](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown) - Use this to get more information on Obsidian's supported syntax
|
||||
[GFM cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) - Use this as a quick guide to using Markdown for Github
|
||||
|
||||
## Other useful pages
|
||||
|
||||
[How to quickly add a simple Markdown-based page](https://guide.portaljs.org/guides/add-a-simple-md-page)
|
||||
[How to quickly edit text content on a single Markdown-based page](https://guide.portaljs.org/guides/edit-text-on-a-single-md-page)
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: Guides and Tutorials
|
||||
description: Learn more about how you can achieve different data portal features with PortalJS
|
||||
---
|
||||
# Guides and tutorials
|
||||
|
||||
- [[howtos/analytics|How to add web analytics?]]
|
||||
- [[howtos/seo|How to customize page metadata for SEO?]]
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to add markdown-based content pages?
|
||||
description: Learn how to add markdown-based content pages on PortalJS data portals
|
||||
---
|
||||
# How to add markdown-based content pages?
|
||||
|
||||
## Add content layer to your app
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: How to push an Obsidian vault to a GitHub repository
|
||||
date: 2023-07-27
|
||||
authors: ['Jake Hirsch', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
This howto walks you through the process of setting up your Obsidian vault as a GitHub repository. Here are some of the benefits of doing so:
|
||||
@@ -37,7 +34,7 @@ In this howto, we will use the GitHub Desktop application, an easy-to-use interf
|
||||
|
||||
2.6. Add an optional description.
|
||||
|
||||
2.7. Make sure the checkbox "Initialise this repository with a README" is unchecked, and "Git Ignore" and "License" are set to "None".
|
||||
2.7. Make sure the checkbox "Initialize this repository with a README" is unchecked, and "Git Ignore" and "License" are set to "None".
|
||||
|
||||
2.8. Click on "Create Repository".
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: How to quickly create a sandbox website
|
||||
date: 2023-07-27
|
||||
authors: ['Lauren Wigmore', 'Ola Rubaj']
|
||||
filetype: 'blog'
|
||||
---
|
||||
|
||||
By the end of this guide you will have a working markdown site you can edit, which gets published automatically online 🎉
|
||||
@@ -25,8 +22,13 @@ The website will then be deployed. This takes approximately 1 minute.
|
||||
|
||||
Once you are on the Congratulations screen, click on the preview of your sandbox website to see the live/published version.
|
||||
|
||||
For instructions on how to add and edit pages, we recommend these howtos:
|
||||
For instructions on how to add and edit pages, we recommend these tutorials:
|
||||
|
||||
- [[howtos/add-a-simple-md-page|How to add a simple markdown page]]
|
||||
- [[howtos/edit-text-on-a-single-md-page|How to edit text on a single markdown-based page]]
|
||||
- [[howtos/edit-or-add-md-pages-locally|How to edit or add a markdown page locally on your computer]]
|
||||
- [[edit-a-page-with-code-editor-or-obsidian|How to edit text content on a single Markdown-based page]]
|
||||
- [[add-a-simple-md-page|How to add a simple Markdown-based page]]
|
||||
|
||||
Here are some other links Vercel links that might be useful for you:
|
||||
|
||||
- [Dashboard Features Overview](https://vercel.com/docs/concepts/dashboard-features/overview)
|
||||
- [Dashboard Features](https://vercel.com/docs/concepts/dashboard-features)
|
||||
- [Projects](https://vercel.com/docs/concepts/projects/project-dashboard)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to customize page metadata for SEO?
|
||||
description: Learn to customize page metadata for SEO on data portals with PortalJS
|
||||
---
|
||||
# How to customize page metadata for SEO?
|
||||
|
||||
>[!info]
|
||||
>See [`next-seo` documentation](https://github.com/garmeeh/next-seo) to learn more.
|
||||
@@ -79,4 +76,4 @@ export default function Page() (
|
||||
```
|
||||
|
||||
>[!info]
|
||||
> To learn more on per-page SEO configuration with `next-seo`, see [this docs section](https://github.com/garmeeh/next-seo#add-seo-to-page)
|
||||
> To learn more on per-page SEO configuration with `next-seo`, see [this docs section](https://github.com/garmeeh/next-seo#add-seo-to-page)
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
title: How to build a sitemap?
|
||||
description: Learn how to build a sitemap for a data portal with PortalJS
|
||||
---
|
||||
# How to build a sitemap?
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -94,4 +91,4 @@ Add this to the scripts section in your `package.json` to regenerate the sitemap
|
||||
|
||||
"prebuild": "node ./scripts/sitemap.mjs",
|
||||
|
||||
```
|
||||
```
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Why use these tools to create a catalog?"
|
||||
isDraft: true
|
||||
---
|
||||
|
||||
On this site, we offer a “recipe” which uses a combination of free tools to easily create a directory of information that can be used for multiple purposes. With this method, you can start capturing information quickly and intuitively in a format that is flexible and usable later for various needs. Why does this help us? Because to map information – to collect, organise, structure, and classify it – and present it clearly is a way to make more sense of it and therefore of the world around us.
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function DefaultLayout({ children, ...frontMatter }) {
|
||||
{/* Default layout */}
|
||||
{!frontMatter.layout && (
|
||||
<>
|
||||
{!frontMatter.disableTitle && <h1>{frontMatter.title}</h1>}
|
||||
<h1>{frontMatter.title}</h1>
|
||||
{frontMatter.author && (
|
||||
<div className="-mt-6">
|
||||
<p className="opacity-60 pl-1">{frontMatter.author}</p>
|
||||
|
||||
@@ -13,7 +13,7 @@ export const DocsLayout: React.FC<any> = ({ children, ...frontMatter }) => {
|
||||
<time dateTime={created}>{formatDate(created)}</time>
|
||||
</p>
|
||||
)}
|
||||
{!frontMatter.disableTitle && title && <h1>{title}</h1>}
|
||||
{title && <h1>{title}</h1>}
|
||||
</div>
|
||||
</header>
|
||||
<section>{children}</section>
|
||||
|
||||