| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PatternFly-React preview: https://patternfly-react-pr-2796.surge.sh |
Sorry, something went wrong.
|
linking #94 related (and started today in Insights Subscriptions) |
Sorry, something went wrong.
|
(apologies for late and possibly misplaced comment) Not sure where to note this, but i think overlapping area charts with transparency makes this trickier. I'd like to see this applied to a stacked area chart as well. Speaking of which.. we don't seem to have one? |
Sorry, something went wrong.
|
Note that a threshold line can be applied on top of other areas / lines, grids, etc. to be more visible. It's simply a matter of ordering. We don't have a stacked area chart example, but that would be easy to create. Simply wrap the ChartArea components with ChartStack. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Considering the threshold is just another line, the ChartLine component would simply apply the next color in the color scale / family. Threshold colors are explicitly set in this example. I believe we can customize the dash length and gap size. However, if a threshold requires different properties, we may need to consider creating a new component? Regarding the dashed lines, Cost Management uses both solid and dashed lines to show the difference between the current and previous month's data. Can the dash symbol be optional depending on your usage? Perhaps we can suggest possible alternatives? Custom tooltips are a definitely a technical challenge. What did you have in mind? |
Sorry, something went wrong.
|
This looks really great, and the proposed rules @mceledonia has here would work for the use case I am aware of for Subscriptions UI (one threshold line not specifically related to any of the 2-3 area values). |
Sorry, something went wrong.
|
@dlabrecq I don't think the tooltips are necessary for the thresholds (chime in if anyone disagrees here) but figured if they're easy to toss in, they wouldn't hurt. I'm thinking the juice isn't worth the squeeze there. For the dashed lines, since we have control over gap length and size, it's possible we recommend a dash style for values and a dash style for thresholds. They can be distinguishable enough to work I think, here's a quick example: |
Sorry, something went wrong.
|
@mceledonia We can easily add a tooltip for thresholds -- no problem there. I just thought you were hinting at something different about the tooltip layout. A different dashed line can be implemented for thresholds. Although, we should create a new component in that case, so everyone could apply the same threshold styling. We may also need to create a new legend symbol? I created the dash myself for use in Cost Management -- not easy to customize. |
Sorry, something went wrong.
|
i've started a ChartThreshold component just now alongside this PR. No visual changes yet for the dash style, but it would be defaulted inside the ChartThreshold component and overridable by the consumer. @dlabrecq @cdcabrera - please weigh in and give a bit more specific feedback here once ready. I am happy to move forward however best! |
Sorry, something went wrong.
|
IMO, we need a different dash style for thresholds. That's the main reason for creating a new ChartThreshold component (i.e., so users won't need to override styling). Users won't be able to override the dash symbol for legends. We must create a new legend symbol for thresholds that folks can easily apply. //cc @mceledonia |
Sorry, something went wrong.
|
Took the liberty of creating a POC, showing how to create a new legend symbol for thresholds. You can find the code here: #2884 |
Sorry, something went wrong.
|
ok, after chatting w/ @dlabrecq - the proposal is to use the new threshold legend symbol created in #2884 instead of dash symbol. Also, we can move ChartThreshold towards a theme for adding the default strokeDashArray and add a getThresholdTheme function (similar to ChartDonut's getDonutTheme function here) |
Sorry, something went wrong.
| } | ||
| height={250} | ||
| padding={{ | ||
| bottom: 100, // Adjusted to accomodate legend |
There was a problem hiding this comment.
adding some additional height in new container class area-chart-threshold-bottom-responsive and inside the legend bottom padding to accommodate multi row legend
Sorry, something went wrong.
| ...rest | ||
| }: ChartLineProps) => { | ||
| const theme = getThresholdTheme(themeColor, themeVariant); | ||
| return ( |
There was a problem hiding this comment.
when extending ChartLineProps this way, it seems style prop will override theme. This method works for allowing theme colors, but would prevent the consumer from override style and theme directly. Any suggestions @dlabrecq ? I think this is close to what we discussed...
Sorry, something went wrong.
There was a problem hiding this comment.
I believe this is expected behavior. When overriding the padding prop; for example, users must provide all padding variables; top, bottom, left, right.
Sorry, something went wrong.
| line: { | ||
| style: { | ||
| data: { | ||
| strokeDasharray: '6,6' |
There was a problem hiding this comment.
updated to 6,6
Sorry, something went wrong.
|
thanks for the extensive feedback, and finally circling back here....here's my updates on this:
Noted that this should still be safe to consume later in Subscriptions (current usage here): |
Sorry, something went wrong.
| { name: 'Birds Threshold', x: 5, y: 3 } | ||
| ]} | ||
| themeColor={ChartThemeColor.orange} | ||
| themeVariant={ChartThemeVariant.light} |
There was a problem hiding this comment.
You can remove the themeVariant, it defaults to ChartThemeVariant.light
Sorry, something went wrong.
| ...rest | ||
| }: ChartLineProps) => { | ||
| const theme = getThresholdTheme(themeColor, themeVariant); | ||
| return ( |
There was a problem hiding this comment.
I believe this is expected behavior. When overriding the padding prop; for example, users must provide all padding variables; top, bottom, left, right.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
LGTM! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What:
Horizontal Indicator example for Area Charts. Currently reviewing this from a UX/design perspective.
Opened PF issue 2797 for this documentation.
Demo (Multi-color chart with threshold indicators and responsive container example):
https://patternfly-react-pr-2796.surge.sh/patternfly-4/charts/chartarea/
Current Questions:
* What color themes do we think appropriate for indicators?
* What stroke width do we find legible for indicators?
* Should indicators be connected lines or independent line segments?
* How should we handle mobile legends gracefully?
* Do we need custom threshold tooltip behavior?
Desktop:

Tablet:

Mobile:
