Skip to content

Instantly share code, notes, and snippets.

View rayrayzayzay's full-sized avatar

Rachel Zack rayrayzayzay

View GitHub Profile
{ "exp", base, [[stop_1, value_1],...[stop_n, value_n]] }
const paintProperties: MapLibreStyleProperty[] = [
{ styleName: "line-color", fslName: "color" },
{ styleName: "line-opacity", fslName: "opacity" },
{ styleName: "line-dasharray", fslName: "dashArray" },
{ styleName: "line-width", fslName: "width" },
];
const layoutProperties: MapLibreStyleProperty[] = [
{ styleName: "line-join", fslName: "lineJoin" },
{ styleName: "line-cap", fslName: "lineCap" },
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "strahler_order"
"steps": [1, 8],
},
"style": {
"size": [1, 4],
"opacity": [0.4, 1],
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "strahler_order"
"steps": [1, 8],
},
"style": {
"size": [1, 4],
"color": ["#4b5899", "#2cbaa8", "#e8e873"],
@rayrayzayzay
rayrayzayzay / Style for Map of Mass Shootings in the US
Last active January 31, 2023 22:53
Style for Map of Mass Shootings in the US
"visualizations": [
{
"type": "numeric",
"config": {
"labelAttribute": ["fatalities"],
"numericAttribute": "fatalities",
"steps": [3, 21]
},
"style": {
"size": [10, 50],
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "AWDT",
"steps": [400, 98700]
},
"style": {
"size": [1, 18],
"color": "hsl(3, 62%, 43%)",
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "tonnes",
"steps": [33000, 2344684]
},
"style": {
"size": [5, 48],
"color": "hsl(47, 67%, 50%)",
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "contour",
"steps": [100, 13700]
},
"style": {
"color": ["#4b5899", "#2cbaa8", "#e8e873"],
"size": 2.5,
@rayrayzayzay
rayrayzayzay / Numeric Visualizations
Last active January 30, 2023 22:55
Numeric Visualizations
"visualizations": [
{
"dataset": "406862c2-0e38-46e3-87de-15ac79316396",
"type": "numeric",
"config": {
"numericAttribute": "capacity_percent",
"steps": [29, 44, 61, 73, 84]
},
"style": {
"size": [5, 15, 20, 25],
function makeCursorUrl(
base64svg: string,
size: number,
fallback = "auto"
): string {
const centre = size / 2;
return `url(${base64svg})
${centre} ${centre}, ${fallback}`;
}