Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hillarymarler
Copy link
Collaborator

  • Added two new color palette related functions:
  1. TADA_ColorPalette - creates colorblind accessible palette for use in TADA visualizations
  2. TADA_ViewColorPalette - view palette color swatches with labels identifying their position in palette and hex code for easier future development (or if users want to design additional figures with a similar look)
  • Applied the new palette to the following functions:
  1. TADA_Boxplot
  2. TADA_Histogram
  3. TADA_OverviewMap
  4. TADA_FieldValuesPieChart
  5. TADA_Scatterplot
  6. TADA_TwoCharacteristicScatterplot

We may want to discuss some additional options for TADA_FieldValuesPieChart as the number of colors required can exceed the number in the palette (n = 9). Right now I am using color ramp to generate additional colors, but it doesn't always look great. Might be worth adding some additional colors to the palette in TADA_ColorPalette? And then only using color ramp if a really large number of colors is needed?

hillarymarler and others added 30 commits January 9, 2024 14:34
Draft function working other than displaying "adding missing grouping variables" - need to figure out where that is coming from
Documentation and print message updates
Update CharacteristicName to TADA.CharacteristicName in function
updated print messages for daily agg options
updates to documentation and remove intermediate objects
Added clean option for returning data frame. Style updates.
Added depth column info to documentation, changed clean to aggregatedonly, specified location types in documentation
Updated dailyagg and documentation, made sure depthcat.list was used throughout function, updated printed messages to match updated dailyagg
Fixed error in example and documentation
fixed error in example
Added option for user to input meters from surface/bottom that should be considered for surface and bottom samples.
started work on creating depth profile figure
Figure updates and fixed length units issue in WQX ref table. Target unit is m only for length units
update to add TADA.ConsolidatedDepth to flag function
@hillarymarler
Copy link
Collaborator Author

My thoughts so far:

...new columns generated by some of the depth functions are appended to the end of the dataframe (TADA.ConsolidatedDpeth.Bottom, TADA.DepthCategory.Flag, TADA.DepthProfileAggregation.Flag & there may be more). Can you add any new columns that are created to the require.cols list at the top of RequiredCols.R.

Yes I will add those to require.cols in RequiredCols.R

"adding some additional colors to the palette in TADA_ColorPalette and then only using color ramp if a really large number of colors is needed". Do you want to create a separate issue for that or include in this PR?

This is not difficult technically, but I will do that separately as I will need seem time to figure out which colors to add so that the palette remains colorblind accessible

  • The orange outline for sites in the TADA_OverviewMap is a bit faint/hard to see. Should we use the same dark blue outline for the sites that is used for TADA_Scatterplot point outlines

Yes, I'll change this

  • In TADA_TwoCharacteristicScatterplot the second char points are orange with a blue outline. Could these have a darker orange outline instead? So the inside would be Created TADA_AutoClean.R #2 in the TADA palette and outline would be [7]

Yes, I'll change this

  • TADA_FieldValuesPie. For figures like this that use a lot of colors, I am wondering if the TADA_ColorPalette could specify by default which colors to use first and in which order? For example, if we always want to use blue first followed by orange) can that specification be included in TADA_ColorPalette?

I have noticed that the order of the colors in the palette does not seem to determine which colors are selected first in TAD_FieldValuesPie. I think we should specify the order we want the colors used in, but it may need to happen within the plotly functions used to create the figure. I think there is a way to tell it to use the colors in order from the palette or specify the order within the function. I'll take a look at this and figure out the best place to do it.

Updated TADA_DepthCategory.Flag to TADA_FlagDepthCategory to keep naming convention consistent with rest of package
Updates for TADA_FlagDepthCategory documentation and for documentation for other functions that use it
Added columns created in TADA_FlagDepthCategory to required cols
Changed outline for makers to a darker orange color (#7 from tada palette)
Change outline to dark blue (tada.pal[6])
Updated colors in TADA_TwoCharacteristicScatterplot and TADA_FieldValuesPie, some updates to TADA_ColorPalette to expand color palette
Did not modify ATTAINS map colors, reverted to original colors
Control colors by using add_boxplot
All boxplot features working correctly in simplified code (no need to use add_boxplot)
Fix so that correct number of colors are assigned for data set
Modified palette to agree with viewATTAINS map colors (slight changes) and hard-coded color choices into a palette rather than relying on a color ramp off an existing palette
updated to reflect additional distinct colors in pie chart
Updated color ramp function to build larger color palette to run off new tada palette, not default palette
@hillarymarler
Copy link
Collaborator Author

@hillarymarler I tried running TADA_DepthProfilePlot with the surfacevalue and bottomvalue null which currently produces as error message. Recommendation: update this so that when these inputs are null, the function returns the figure without the black horizontal lines and text on the figure marking surface, middle, and bottom.

> TADA_DepthProfilePlot(Data_6Tribes_5y_Harmonized,
+                       groups = c("TEMPERATURE_NA_NA_DEG C", "PH_NA_NA_NA", "DEPTH, SECCHI DISK DEPTH_NA_NA_M"),
+                       location = "REDLAKE_WQX-ANKE",
+                       activity_date = "2018-10-04", 
+                       surfacevalue = NULL,
+                       bottomvalue = NULL)
[1] "TADA_DepthProfilePlot: Running TADA_DepthCategoryFlag function to add required columns to data frame"
[1] "TADA_DepthCategory.Flag: checking data set for depth values. 69516 results have depth values available."
[1] "TADA_DepthCategory.Flag: assigning depth categories."
[1] "TADA_DepthCategory.Flag: Grouping results by MonitoringLocationIdentifier, OrganizationIdentifier, CharacteristicName, and ActivityStartDate for aggregation for entire water column."
[1] "TADA_DepthCategory.Flag: No aggregation performed."
[1] "TADA_DepthProfilePlot: Depth unit in data set matches depth unit specified by user for plot. No conversion necessary."
[1] "TADA_DepthProfilePlot: Identifying available depth profile data."
[1] "TADA_DepthProfilePlot: Any results for DEPTH, SECCHI DISK DEPTH, DEPTH, SECCHI DISK DEPTH (CHOICE LIST), DEPTH, SECCHI DISK DEPTH REAPPEARS, DEPTH, DATA-LOGGER (NON-PORTED), DEPTH, DATA-LOGGER (PORTED), RBP STREAM DEPTH - RIFFLE, RBP STREAM DEPTH - RUN, THALWEG DEPTH match the depth unit selected for the figure."
Joining with `by = join_by(ActivityTypeCode, TADA.ActivityType.Flag, ActivityMediaName, TADA.ActivityMediaName,
ActivityMediaSubdivisionName, ResultSampleFractionText, TADA.ResultSampleFractionText, TADA.SampleFraction.Flag,
TADA.FractionAssumptions, CharacteristicName, TADA.CharacteristicName, TADA.CharacteristicNameAssumptions, SubjectTaxonomicName,
SampleTissueAnatomyName, MethodSpeciationName, TADA.MethodSpeciationName, TADA.MethodSpeciation.Flag,
TADA.SpeciationAssumptions, TADA.ComparableDataIdentifier, TADA.Harmonized.Flag, ActivityStartDate, ActivityStartTime.Time,
ActivityStartTime.TimeZoneCode, ActivityStartDateTime, ResultMeasureValue, TADA.ResultMeasureValue,
TADA.ResultMeasureValueDataTypes.Flag, ResultValueTypeName, TADA.ResultValueAboveUpperThreshold.Flag,
TADA.ResultValueBelowLowerThreshold.Flag, ResultMeasure.MeasureUnitCode, TADA.ResultMeasure.MeasureUnitCode,
TADA.WQXResultUnitConversion, TADA.ResultUnit.Flag, ResultDetectionConditionText, DetectionQuantitationLimitTypeName,
DetectionQuantitationLimitMeasure.MeasureValue, TADA.DetectionQuantitationLimitMeasure.MeasureValue,
TADA.DetectionQuantitationLimitMeasure.MeasureValueDataTypes.Flag, DetectionQuantitationLimitMeasure.MeasureUnitCode,
TADA.DetectionQuantitationLimitMeasure.MeasureUnitCode, TADA.CensoredData.Flag, TADA.CensoredMethod, TADA.ConsolidatedDepth,
TADA.ConsolidatedDepth.Unit, ResultDepthHeightMeasure.MeasureValue, TADA.ResultDepthHeightMeasure.MeasureValue,
TADA.ResultDepthHeightMeasure.MeasureValueDataTypes.Flag, ResultDepthHeightMeasure.MeasureUnitCode,
TADA.ResultDepthHeightMeasure.MeasureUnitCode, ResultDepthAltitudeReferencePointText, ActivityRelativeDepthName,
ActivityDepthHeightMeasure.MeasureValue, TADA.ActivityDepthHeightMeasure.MeasureValue,
TADA.ActivityDepthHeightMeasure.MeasureValueDataTypes.Flag, ActivityDepthHeightMeasure.MeasureUnitCode,
TADA.ActivityDepthHeightMeasure.MeasureUnitCode, ActivityTopDepthHeightMeasure.MeasureValue,
TADA.ActivityTopDepthHeightMeasure.MeasureValue, TADA.ActivityTopDepthHeightMeasure.MeasureValueDataTypes.Flag,
ActivityTopDepthHeightMeasure.MeasureUnitCode, TADA.ActivityTopDepthHeightMeasure.MeasureUnitCode,
ActivityBottomDepthHeightMeasure.MeasureValue, TADA.ActivityBottomDepthHeightMeasure.MeasureValue,
TADA.ActivityBottomDepthHeightMeasure.MeasureValueDataTypes.Flag, ActivityBottomDepthHeightMeasure.MeasureUnitCode,
TADA.ActivityBottomDepthHeightMeasure.MeasureUnitCode, ResultTimeBasisText, StatisticalBaseCode, ResultFileUrl,
ResultAnalyticalMethod.MethodName, ResultAnalyticalMethod.MethodDescriptionText, ResultAnalyticalMethod.MethodIdentifier,
ResultAnalyticalMethod.MethodIdentifierContext, ResultAnalyticalMethod.MethodUrl, TADA.AnalyticalMethod.Flag,
SampleCollectionMethod.MethodIdentifier, SampleCollectionMethod.MethodIdentifierContext, SampleCollectionMethod.MethodName,
SampleCollectionMethod.MethodDescriptionText, SampleCollectionEquipmentName, MeasureQualifierCode,
TADA.MeasureQualifierCode.Flag, TADA.MeasureQualifierCode.Def, ResultCommentText, ActivityCommentText, HydrologicCondition,
HydrologicEvent, DataQuality.PrecisionValue, DataQuality.BiasValue, DataQuality.ConfidenceIntervalValue,
DataQuality.UpperConfidenceLimitValue, DataQuality.LowerConfidenceLimitValue, SamplingDesignTypeCode, LaboratoryName,
ResultLaboratoryCommentText, ResultIdentifier, ActivityIdentifier, OrganizationIdentifier, OrganizationFormalName,
TADA.MultipleOrgDuplicate, TADA.MultipleOrgDupGroupID, TADA.ResultSelectedMultipleOrgs, TADA.SingleOrgDupGroupID,
TADA.SingleOrgDup.Flag, ProjectName, ProjectDescriptionText, ProjectIdentifier, ProjectFileUrl, QAPPApprovedIndicator,
QAPPApprovalAgencyName, CountryCode, StateCode, CountyCode, MonitoringLocationName, MonitoringLocationTypeName,
MonitoringLocationDescriptionText, LatitudeMeasure, TADA.LatitudeMeasure, LongitudeMeasure, TADA.LongitudeMeasure,
HorizontalCoordinateReferenceSystemDatumName, HUCEightDigitCode, MonitoringLocationIdentifier, TADA.NearbySiteGroups,
AquiferName, AquiferTypeName, LocalAqfrName, ConstructionDateText, WellDepthMeasure.MeasureValue,
WellDepthMeasure.MeasureUnitCode, WellHoleDepthMeasure.MeasureValue, WellHoleDepthMeasure.MeasureUnitCode,
ActivityDepthAltitudeReferencePointText, ActivityEndDate, ActivityEndTime.Time, ActivityEndTime.TimeZoneCode,
ActivityEndDateTime, ActivityConductingOrganizationText, SampleAquifer, ActivityLocation.LatitudeMeasure,
ActivityLocation.LongitudeMeasure, ResultStatusIdentifier, ResultWeightBasisText, ResultTemperatureBasisText,
ResultParticleSizeBasisText, USGSPCode, BinaryObjectFileName, BinaryObjectFileTypeCode, AnalysisStartDate,
ResultDetectionQuantitationLimitUrl, LabSamplePreparationUrl, timeZoneStart, timeZoneEnd, SourceMapScaleNumeric,
HorizontalAccuracyMeasure.MeasureValue, HorizontalAccuracyMeasure.MeasureUnitCode, HorizontalCollectionMethodName,
VerticalMeasure.MeasureValue, VerticalMeasure.MeasureUnitCode, VerticalAccuracyMeasure.MeasureValue,
VerticalAccuracyMeasure.MeasureUnitCode, VerticalCollectionMethodName, VerticalCoordinateReferenceSystemDatumName,
FormationTypeText, ProjectMonitoringLocationWeightingUrl, DrainageAreaMeasure.MeasureValue, DrainageAreaMeasure.MeasureUnitCode,
ContributingDrainageAreaMeasure.MeasureValue, ContributingDrainageAreaMeasure.MeasureUnitCode, ProviderName, LastUpdated,
TADA.ConsolidatedDepth.Bottom, TADA.DepthCategory.Flag, TADA.DepthProfileAggregation.Flag)`
[1] "TADA_DepthProfilePlot: Adding surface delination to figure."
Error: Must supply `x` and `y` attributes

@cristinamullin should "null" be the default for surfacevalue and bottomvalue in this function?

@cristinamullin
Copy link
Collaborator

cristinamullin commented May 23, 2024 via email

…ile plot

Updates to accept null values for surface value and bottom value in depth profile plot. Not complete yet.
…value

Separated annotations for depth categories
Updated annotations so they are added one at a time (to accommodate null values for surfacevalue and bottomvalue.
Fix bugs related to null surface and bottomvalues
Switched colors to TADA Palette for DepthProfile Plot, updated documentation
Corrected TADA_FieldValuesPie so that an expanded color palette is created and applied as needed
@hillarymarler
Copy link
Collaborator Author

@cristinamullin - ready for review


# Result Depth
"TADA.ConsolidatedDepth",
"TADA.ConsolidatedDepth.Bottom",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a TADA.ConsolidatedDepth.Surface as well?

@cristinamullin cristinamullin merged commit 539ac03 into develop May 24, 2024
@cristinamullin cristinamullin deleted the colorpalette_set_up branch May 24, 2024 21:15
@cristinamullin cristinamullin restored the colorpalette_set_up branch May 24, 2024 21:58
@cristinamullin cristinamullin deleted the colorpalette_set_up branch May 28, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address Depth Profile Data

3 participants