Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': animation_filter
},
'line': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': animation_filter
},
'polygon': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}), {4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 0.9)
),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': animation_filter
}
}
return Style(data, 'color-category', value)
'equal': 'purpor',
'stdev': 'temps'
}.get(method)
else:
func = 'buckets'
default_palette = 'purpor'
breaks = list(breaks)
animation_filter = 'animation(linear(${}), 20, fade(1,1))'.format(animate) if animate else '1'
data = {
'point': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, breaks or bins,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': animation_filter
},
'line': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, breaks or bins,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': animation_filter
},
'polygon': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}), {4})'.format(
func, value, breaks or bins,
},
'line': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': animation_filter
},
'polygon': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}), {4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 0.9)
),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': animation_filter
}
}
return Style(data, 'color-category', value)
data = {
'point': {
'color': get_value(color, 'color', 'point'),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': get_value(opacity, 1)
},
'line': {
'color': get_value(color, 'color', 'line'),
'width': get_value(size, 'width', 'line'),
'filter': get_value(opacity, 1)
},
'polygon': {
'color': get_value(color, 'color', 'polygon'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': get_value(opacity, 0.9)
}
}
return Style(data, 'default')
'point': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, breaks or bins,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': animation_filter
},
'line': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, breaks or bins,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': animation_filter
},
'polygon': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}), {4})'.format(
func, value, breaks or bins,
serialize_palette(palette) or default_palette,
get_value(opacity, 0.9)),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': animation_filter
}
}
return Style(data, 'color-bins', value)
'line': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}),{4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': animation_filter
},
'polygon': {
'color': 'opacity(ramp({0}(${1}, {2}), {3}), {4})'.format(
func, value, cat or top,
serialize_palette(palette) or default_palette,
get_value(opacity, 0.9)
),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': animation_filter
}
}
return Style(data, 'color-category', value)
get_value(opacity, 1)),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': _animation_filter(value, duration, fade)
},
'line': {
'color': 'opacity({0}, {1})'.format(
get_value(color, 'color', 'line'),
get_value(opacity, 1)),
'width': get_value(size, 'width', 'line'),
'filter': _animation_filter(value, duration, fade)
},
'polygon': {
'color': 'opacity({0}, {1})'.format(
get_value(color, 'color', 'polygon'),
get_value(opacity, 0.8)),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': _animation_filter(value, duration, fade)
}
}
return Style(data, 'animation', value)
data = {
'point': {
'color': get_value(color, 'color', 'point'),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': get_value(opacity, 1)
},
'line': {
'color': get_value(color, 'color', 'line'),
'width': get_value(size, 'width', 'line'),
'filter': get_value(opacity, 1)
},
'polygon': {
'color': get_value(color, 'color', 'polygon'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': get_value(opacity, 0.9)
}
}
return Style(data, 'default')
'color': get_value(color, 'color', 'point'),
'width': get_value(size, 'width', 'point'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': get_value(opacity, 1)
},
'line': {
'color': get_value(color, 'color', 'line'),
'width': get_value(size, 'width', 'line'),
'filter': get_value(opacity, 1)
},
'polygon': {
'color': get_value(color, 'color', 'polygon'),
'strokeColor': get_value(stroke_color, 'strokeColor', 'polygon'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'polygon'),
'filter': get_value(opacity, 0.9)
}
}
return Style(data, 'default')
Returns:
:py:class:`Style `
"""
cluster_operation = _get_cluster_operation(operation, value)
cluster_operation_title = _get_cluster_operation_title(operation, value)
breakpoints = _get_breakpoints(resolution)
animation_filter = _get_animation(animate, cluster_operation)
data = {
'point': {
'width': 'ramp(linear({0}, viewportMIN({0}), viewportMAX({0})), [{1}])'.format(
cluster_operation, breakpoints),
'color': 'opacity({0}, {1})'.format(
color or '#FFB927', get_value(opacity, 0.8)),
'strokeColor': get_value(stroke_color, 'strokeColor', 'point'),
'strokeWidth': get_value(stroke_width, 'strokeWidth', 'point'),
'filter': animation_filter,
'resolution': '{0}'.format(resolution)
}
}
popups = {
'hover': get_popup(True, alt_title=cluster_operation_title, alt_value=cluster_operation, operation=True)
}
return Style(data, 'cluster-size', value, popups)