//ls_match is a 0/1 property, so multiplying by that will either show or hide the original
//You can substitute global for viewport in the example below.
viz={
constviz=newcarto.Viz(`
@size: $labelrank,
@multiplier: $ls_match,
@newSize: @size * @multiplier,
@agg_avg: viewportAvg($labelrank),
@agg_total: viewportCount($labelrank),
color: blue,
width: @newSize * @agg_avg
`)
returnviz
}
agg_total=viz.variables.agg_total.eval()
agg_avg=viz.variables.agg_avg.eval()
layer={
constlayer=newcarto.Layer('layer',source,viz);
returnlayer
}
layer.addTo(map,'watername_ocean')
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.