You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the work on Chart (specifically the VisualChannel construct), we have a couple of types that aren't currently covered which should be:
The (default-ish) output type needed to draw into a GraphicsContext is CGFloat - for better or worse, so we probably need explicit implementations that output there instead of (or in addition to) the current Float. That may mean we want to reconsider how those mappings are happening, not sure.
In addition, there's a need for scales that convert values (Int, Float, Double, etc) into colors. I suspect that's probably a variation of LinearScale, but the interpolated output should be a type of color, or a type that can be easily converted into a color. First cut pass, maybe CGColor from CoreGraphics, but a general color representation might not be amiss that can apply over into SwiftUI color, UIKit/UIColor, or AppKit/NSColor as needed.
Finally, we need some discrete scales - none currently in play, to enable bar charts - something that takes a list of categories (represented by a [String]) and can return a spacing location for the center, or be used to calculate the relevant positioning with a width and spacing. So again, output to CGFloat, input a Collection - where first cut of Something is String
The secondary output type for the discrete scale is color - to enable color to be used to provide an indicator of an underlying category choice in things like Dot or Line charts.
The text was updated successfully, but these errors were encountered:
Broke out color scales (#6) and discrete scales (#7) from this issue - enabling CGFloat as the output type for existing Linear, Log, and Pow concrete scales
heckj
changed the title
Broaden input and output types with scales
Add concrete scale implementations that support CGFloat as an output type
Mar 31, 2022
For the work on
Chart
(specifically the VisualChannel construct), we have a couple of types that aren't currently covered which should be:The (default-ish) output type needed to draw into a GraphicsContext is CGFloat - for better or worse, so we probably need explicit implementations that output there instead of (or in addition to) the current Float. That may mean we want to reconsider how those mappings are happening, not sure.
In addition, there's a need for scales that convert values (Int, Float, Double, etc) into colors. I suspect that's probably a variation of LinearScale, but the interpolated output should be a type of color, or a type that can be easily converted into a color. First cut pass, maybe
CGColor
from CoreGraphics, but a general color representation might not be amiss that can apply over into SwiftUI color, UIKit/UIColor, or AppKit/NSColor as needed.Finally, we need some discrete scales - none currently in play, to enable bar charts - something that takes a list of categories (represented by a [String]) and can return a spacing location for the center, or be used to calculate the relevant positioning with a width and spacing. So again, output to CGFloat, input a Collection - where first cut of Something is
String
The secondary output type for the discrete scale is color - to enable color to be used to provide an indicator of an underlying category choice in things like
Dot
orLine
charts.The text was updated successfully, but these errors were encountered: