ObjectProfile / Roassal3

The Roassal Visualization Engine
MIT License
95 stars 52 forks source link

RSViolinPlot feedback #567

Closed akevalion closed 8 months ago

akevalion commented 1 year ago

From hernan we have this

Data Input

Source Status Suggested method Priority Example
Array OK    
DataFrame MISSING #fromDataFrame: HIGH | toothGrowthDose | toothGrowthDose := AIDatasets loadToothGrowth. (RSViolinPlot fromDataFrame: toothGrowthDose) open.
Array of arrays MISSING #fromCollection: HIGH | toothGrowthDose | toothGrowthDose := (AIDatasets loadToothGrowth) column: 'dose'. (RSViolinPlot fromCollection: toothGrowthDose asArray) open.

Colors

Feature Status Suggested method Priority Example
Area color OK #color: acts as #areaColor: LOW
Line colors (the white vertical line represents the line color) MISSING #centerLineColor:, #medianLineColor: NORMAL customized-violin-plot-r
Border color MISSING #borderColor: aColor "Apply the same border color to any violin"#borderColors: aCollectionOfColor "Apply the border colors in aCollectionOfColor to the violin groups" NORMAL ggplot2-violin-plot-change-group-line-colors-data-visualization-1 
Median color MISSING #medianColor:, #medianColor: NORMAL  ggplot2-violin-plot-add-mean-median-points-data-visualization-2
Mean color MISSING #meanColor:, #meanColor NORMAL  add-mean-violinplot
Color fill by group MISSING #colorFillByGroup: aCollectionOfColor "Fill the violins with aCollectionOfColor in order (i.e. aCollectionOfColor first is applied to Violin 1, aCollectionOfColor second is applied to Violin 2, etc HIGH  ggplot2-violin-plot-change-colors-data-visualization-2

Grouping + Overlays

Feature Status Suggested method Priority Example
Box plot distribution inside violin OK    
Scatter plot distribution MISSING specialize #createBox ? NORMAL  scatter_violins-1
Box plot width MISSING #boxWidth: NORMAL  
Scatter plot width MISSING #scatterPlotWidth: NORMAL  
Subgroups (Example: groups are days of the week, and subgroups are Males and Females) MISSING   HIGH  unnamed-chunk-1-1
Multiple groups MISSING #fromLevels: or #fromSubsets: or #fromGroups: etc. HIGH  ggplot2-violin-plot-change-colors-data-visualization-2
Sort violin plots by groups (Violin plots are ordered by default by the order of the levels(groups) of the categorical variable) MISSING #orderByGroup: aSymbol ascending: aBoolean or #reorderByGroup: aSymbol HIGH  reorder-violin-plot

Miscellany

Feature Status Suggested method Priority Example
Set Bandwith OK    
Rotate MISSING #rotate: or #beHorizontal, #beVertical NTH  ing
Trimming MISSING #enableTrimming, #disableTrimming NTH  Truncated vs Extended
Set mean shape + size (A point present at the center of the plot indicates the mean point) MISSING #useMeanPointRange, #useMeanPointRangeWithSize: #useMeanPoint, #useMeanPointWithSize: NORMAL  
Set median shape + size MISSING #useMedianPointRange, #useMedianPointRangeWithSize: #useMedianPoint, #useMedianPointWithSize: NORMAL
akevalion commented 11 months ago

Missing

akevalion commented 11 months ago

For rotate code

barPlot := RSBarPlot new.
"RSHorizontalBarPlot new"
...
barPlot beHorizontal.
"another option"
invertStrategy := RSInvertCoordinates new.
barPlot add: invertStrategy.
barPlot coordinates: invertStrategy.
barPlot orientation: invertStrategy.

barPlot open

RSAbstractPlot >> #renderInWithCoordinates: aCanvas self renderIn: aCanvas. coordinates adjustPlots: shapes.

kevca87 commented 11 months ago

Array of arrays ✅

| boxPlot1 |
boxPlot1 := self data: {{6. 8. 7. 5. 7. 11. 9. }. {2. 2. 2. 3. 3. 12. 4. 2. 4. 2. 2. 2. 6. 2. 2. 8. 2. 5. 9. 2. 2. 2. 2. 2.}. }.
boxPlot1 open
kevca87 commented 11 months ago

Area color color:

| violinPlot data |
data := {{-5. 12. 12. 13. 14. 14. 15. 24. }.}.
violinPlot := self data: data.
violinPlot bandwidth: 3.
violinPlot color: Color purple translucent.
violinPlot open.
kevca87 commented 11 months ago

Border color ✅

borderColor:

| violinPlot1 data1 |
data1 := {{6. 8. 7. 5. 7. 11. 9. }. { 12. 12. 13. 15. 18. 20. 21. 24. }}.
violinPlot1 := self data: data1.
violinPlot1 borderColor: Color red.
violinPlot1 open

image

borderColors:

| violinPlot1 data1 |
data1 := {{6. 8. 7. 5. 7. 11. 9. }. { 12. 12. 13. 15. 18. 20. 21. 24. }}.
violinPlot1 := self data: data1.
violinPlot1 borderColors: {Color red. Color purple.}.
violinPlot1 open

image

Border accessing style (of each violin)

| violinPlot2 data2 |
data2 := {{ 12. 12. 13. 15. 18. 20. 21. 24. }.{15. 15. 18. 12. 13. 10. 11. 14.}. {14. 14. 16. 12. 13. 10. 11. 14.}.}.
violinPlot2 := self data: data2.
violinPlot2 borders first color: Color red; dashArray: { 4. }. "way 1"
violinPlot2 violinShapes second borderColor: Color orange. "way 2"
violinPlot2 violinShapes third border color: Color green. "way 3"
violinPlot2 open

image

akevalion commented 8 months ago

We can close this issue as completed