-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget and Feature Enhancements #244
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
12c8ea7
adding capabilities to layers and support for Pro
TimPurdum b993025
wip
TimPurdum e36ff9b
binning and clustering support
TimPurdum 0c1525b
Merge branch 'develop' into feature/feature-enhancements-pro-58
TimPurdum 1bf139f
improve Expand Widget
TimPurdum 460aa10
Testing, cleanup
TimPurdum b9f3180
cleanup
TimPurdum 43c6f38
added missing xml
TimPurdum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
src/dymaptic.GeoBlazor.Core/Components/Layers/ColorVariable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
using dymaptic.GeoBlazor.Core.Objects; | ||
using Microsoft.AspNetCore.Components; | ||
using System.Text.Json.Serialization; | ||
|
||
|
||
namespace dymaptic.GeoBlazor.Core.Components.Layers; | ||
|
||
/// <summary> | ||
/// The color visual variable is used to visualize features along a continuous color ramp based on the values of a numeric attribute field or an expression. The color ramp is defined along a sequence of stops, where color values are mapped to data values. Data values that fall between two stops are assigned a color that is linearly interpolated based on the value's position relative to the closest defined stops. | ||
/// <a target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html">ArcGIS Maps SDK for JavaScript</a> | ||
/// </summary> | ||
public class ColorVariable : VisualVariable | ||
{ | ||
/// <inheritdoc /> | ||
public override VisualVariableType VariableType => VisualVariableType.Color; | ||
|
||
/// <summary> | ||
/// Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in stops should be normalized as percentages or ratios. | ||
/// </summary> | ||
[Parameter] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public string? NormalizationField { get; set; } | ||
|
||
/// <summary> | ||
/// An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the value property in each stop. | ||
/// </summary> | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public IReadOnlyCollection<ColorStop>? Stops | ||
{ | ||
get => _stops; | ||
set | ||
{ | ||
if (value is not null) | ||
{ | ||
_stops = new HashSet<ColorStop>(value); | ||
} | ||
else | ||
{ | ||
_stops = null; | ||
} | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override async Task RegisterChildComponent(MapComponent child) | ||
{ | ||
switch (child) | ||
{ | ||
case ColorStop stop: | ||
_stops ??= new HashSet<ColorStop>(); | ||
_stops.Add(stop); | ||
|
||
break; | ||
default: | ||
await base.RegisterChildComponent(child); | ||
|
||
break; | ||
} | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override async Task UnregisterChildComponent(MapComponent child) | ||
{ | ||
switch (child) | ||
{ | ||
case ColorStop stop: | ||
_stops?.Remove(stop); | ||
|
||
break; | ||
default: | ||
await base.UnregisterChildComponent(child); | ||
|
||
break; | ||
} | ||
} | ||
|
||
internal override void ValidateRequiredChildren() | ||
{ | ||
base.ValidateRequiredChildren(); | ||
|
||
if (_stops is not null) | ||
{ | ||
foreach (ColorStop stop in _stops) | ||
{ | ||
stop.ValidateRequiredChildren(); | ||
} | ||
} | ||
} | ||
|
||
private HashSet<ColorStop>? _stops; | ||
} | ||
|
||
/// <summary> | ||
/// Defines a color stop used for creating a continuous color visualization in a color visual variable. | ||
/// <a target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html">ArcGIS Maps SDK for JavaScript</a> | ||
/// </summary> | ||
public class ColorStop: MapComponent | ||
{ | ||
/// <summary> | ||
/// The Color used to render features with the given value. | ||
/// </summary> | ||
[Parameter] | ||
[RequiredProperty] | ||
public MapColor? Color { get; set; } | ||
|
||
/// <summary> | ||
/// A string value used to label the stop along the color ramp in the Legend. | ||
/// </summary> | ||
[Parameter] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public string? Label { get; set; } | ||
|
||
/// <summary> | ||
/// Specifies the data value to map to the given color. | ||
/// </summary> | ||
[Parameter] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
public double? Value { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a comment