Skip to content

Instantly share code, notes, and snippets.

View rayrayzayzay's full-sized avatar

Rachel Zack rayrayzayzay

View GitHub Profile
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "contour",
"steps": [100, 13700]
},
"style": {
"color": ["#4b5899", "#2cbaa8", "#e8e873"],
"size": 2.5,
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "tonnes",
"steps": [33000, 2344684]
},
"style": {
"size": [5, 48],
"color": "hsl(47, 67%, 50%)",
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "AWDT",
"steps": [400, 98700]
},
"style": {
"size": [1, 18],
"color": "hsl(3, 62%, 43%)",
@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": "strahler_order"
"steps": [1, 8],
},
"style": {
"size": [1, 4],
"color": ["#4b5899", "#2cbaa8", "#e8e873"],
"visualizations": [
{
"type": "numeric",
"config": {
"numericAttribute": "strahler_order"
"steps": [1, 8],
},
"style": {
"size": [1, 4],
"opacity": [0.4, 1],
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" },
{ "exp", base, [[stop_1, value_1],...[stop_n, value_n]] }
public generateExpression(): MapLibreExpression {
return [
"interpolate",
["exponential", this.base],
["zoom"],
...this.stops.map((stop) => [stop[0] - 1, stop[1]]).flat(),
];
}
plug MyAppWeb.Plugs.CheckFeatureFlag,
:upload_anything when action in [:import_layer, :import_elements]
def import_layer(conn, params) do
# Will run if feature flag is enabled, fail otherwise
end