-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat(charts): add remaining variables #1863
Conversation
Deploy preview for pf-next ready! Built with commit 1951dbb |
Looks good! @christiemolloy |
$pf-chart-chart--BorderWidth: 1px; | ||
|
||
// Donut Chart | ||
$pf-chart-donut-color-threshold-large: $pf-color-black-200; |
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.
@dlabrecq donut colors weren't on theme-victory.js do you want them included here?
$pf-chart-boxplot-box--Width: 20px; | ||
|
||
// Bullet Chart | ||
$pf-chart-bullet--comparative-measure-line-warning--BorderColor: $pf-color-orange-300; |
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.
@dlabrecq bullet chart colors and Borders weren't on theme-victory.js do you want them included here?
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.
Yes, please.
We will have a separate theme files for bullet chart, donut, and the new donut utilization charts below. However, we still need the vars to use with the components.
The props for the donut chart can be found here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut.js
The props for the donut utilization chart are here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut-utilization.js
The props for the new donut utilization chart with static thresholds are here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut-threshold.js
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.
@dlabrecq
Updated based on these files. Some questions.
-
In pie chart, what is padAngle?
-
Those font sizes should be 14 and 24 instead of 16 and 26, so they relate to the global font sizes
-
Do you need a variable for: orientation: vertical?
-
inside of the donut key value pairs, is "pie". Do those variables relate to pie or donut? I've seen the same height/width of 230 be used under pie but in the pie variation and in the pie inside of donut.
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.
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.
pie and donut are separate components, but Victory only supports pie charts. When creating a donut theme, we merge the donut properties on top of the pie properties. That gives us the look of the donut, but it's actually a pie chart.
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.
The legend component has a default orientation, so probably not necessary?
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.
That makes sense about pie and donut, and since only colors are defined for donut it keeps the properties of the pie separate.
Also I see in the material.js theme that the legend has an orientation of 'vertical' which is different to the victory file where the legend has an orientation of 'horizontal', so i think ill keep it in there for now?
$pf-chart-bar--Width: 10px; | ||
|
||
// Box Plot Chart | ||
$pf-chart-boxplot-max--Padding: $pf-global--spacer--sm; |
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.
@mcoker I repeat alot of variables that have the same value here, just want to be cautious in case they change what are your thoughts?
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.
I'll defer to @mcoker, but if we have separate vars for each component, then devs can override properties for just that one chart component. That is, without changing properties for all charts.
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.
@dlabrecq agreed.
|
||
|
||
// typography | ||
$pf-chart-global--FontSize: $pf-global--FontSize--sm; |
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.
@mcoker do I need to pull in the Red Hat Font to these style sheet?
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.
@mcoker not sure if you missed this comment :)
|
||
// Area Chart | ||
$pf-chart-area--Opacity: .4; | ||
$pf-chart-area-stroke--Width: 2px; |
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.
@mcoker im not sure whether to break stroke width into two words or not
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.
I think this is fine, though I think we should follow the same general formula we do for other global vars and use $pf-chart-area--stroke--Width
. Though what is the "stroke" width? Is that the same as a border?
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.
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.
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.
Yes, they are different.
$pf-chart-candelstick-data-stroke--Width: 1px; | ||
|
||
// Chart | ||
$pf-chart-chart--BorderWidth: 1px; |
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.
Should the "chart" variation of charts be defined globally? or is it actually a variation @dlabrecq
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.
Chart is a separate component. Basically it's a container which can be used with any chart to provide default functionality like a border, x and y axes, etc.
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.
FYI, the border is currently border: 1px solid
. Do we have solid
defined anywhere?
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.
@dlabrecq when we usually define vars we wouldn't do one for solid, but this makes sense since its the only css defined for use in the victory charts
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.
They could also be separate vars and we concatinate them in the Victory theme?
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.
@mcoker what do you think? borders by default are solid right. Across the system I see alot of border widths without the 'solid'. I'm not sure if the solid is necessary.
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.
The only border I see in the Victory themes is for the Chart component -- not including borderWidth props. Keep in mind that these are SVGs, not CSS props.
|
||
// Donut Chart | ||
$pf-chart-donut-color-threshold-large: $pf-color-black-200; | ||
$pf-chart-donut-color-threshold-medium: $pf-color-black-300; |
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.
@gdoyle1 does small/med/large work here for naming?
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.
first/second/third thresholds
|
||
|
||
// typography | ||
$pf-chart-global--FontSize: $pf-global--FontSize--sm; |
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.
axis labels and scale values should be 12px
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.
for donut charts with the a single label in the middle representing data value, should be 24px
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.
legend should be using 14px text
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 is a good start. We need a few more props, tho.
Note that we cannot consume rem
props, like the global spacers -- must be in pixels.
Likewise, we cannot consume props defined with px
strings. For example, 100px
must be 100
.
If we must define vars as 100px
, we will need to discuss how the charts will consume that.
// typography | ||
$pf-chart-global--FontSize--xs: $pf-global--FontSize--xs; // Axis Labels | ||
$pf-chart-global--FontSize--sm: $pf-global--FontSize--sm; // For Legend | ||
$pf-chart-global--FontSize--2xl: $pf-global--FontSize--2xl; // For Large Numbers |
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.
Do we want to have a var for the chart font family? This is currently hard coded as global_FontFamily_sans_serif.value
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.
I tagged @mcoker about this as I'm not sure the best way to import the new font family
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.
I think so. Seems like we would want the chart theme to only use $pf-chart
vars? Then it allows us the flexibility in the future to deviate from core by simply updating the variable value, instead of also needing to update the react chart theme code.
$pf-chart-boxplot-box--Width: 20px; | ||
|
||
// Bullet Chart | ||
$pf-chart-bullet--comparative-measure-line-warning--BorderColor: $pf-color-orange-300; |
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.
Yes, please.
We will have a separate theme files for bullet chart, donut, and the new donut utilization charts below. However, we still need the vars to use with the components.
The props for the donut chart can be found here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut.js
The props for the donut utilization chart are here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut-utilization.js
The props for the new donut utilization chart with static thresholds are here:
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-charts/src/components/ChartTheme/themes/theme-donut-threshold.js
$pf-chart-candelstick-data-stroke--Width: 1px; | ||
|
||
// Chart | ||
$pf-chart-chart--BorderWidth: 1px; |
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.
Chart is a separate component. Basically it's a container which can be used with any chart to provide default functionality like a border, x and y axes, etc.
$pf-chart-candelstick-data-stroke--Width: 1px; | ||
|
||
// Chart | ||
$pf-chart-chart--BorderWidth: 1px; |
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.
FYI, the border is currently border: 1px solid
. Do we have solid
defined anywhere?
|
||
// Line Chart | ||
$pf-chart-line-stroke--Width: 2px; | ||
|
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.
I noticed that there are some properties that are not defined in victory-theme.js. Apparently, we're getting some defaults by relying on the Victory grayscale theme. However, we probably want to add our own vars. For example, line chart can have these props:
Victory has a grayscale.js theme, which shows the other available props. For example, line can have fill, stroke, strokeWidth, etc.
https://github.com/FormidableLabs/victory/blob/master/packages/victory-core/src/victory-theme/grayscale.js
Victory also has a material.js theme which uses some props that are not listed in grayscale.js. For example, this theme defines an opacity for line chart.
https://github.com/FormidableLabs/victory/blob/master/packages/victory-core/src/victory-theme/material.js
https://github.com/FormidableLabs/victory/blob/master/packages/victory-core/src/victory-theme/material.js
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.
Added in the remaining properties from both of those files
|
||
// Pie Chart | ||
$pf-chart-pie--Padding: $pf-global--spacer--sm; | ||
$pf-chart-pie-data-Padding: $pf-global--spacer--sm; |
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.
I don't believe we can use rem
values here. This must be pixels. For example, the donut relies on this being 8px.
$pf-chart-pie--Width: 230px; | ||
|
||
// Scatter Chart | ||
$pf-chart-stack-data-stroke--Width: 1px; |
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.
The scatter chart currently has strokeWidth set to 0
and stroke as transparent
// Tooltip | ||
$pf-chart-tooltip-pointer--Height: 10px; // this is equivalent to length | ||
$pf-chart-tooltip-pointer--Width: 20px; | ||
$pf-chart-tooltip--Padding: $pf-global--spacer--md; |
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.
|
||
// Voronoi Chart | ||
$pf-chart-voronoi-label--Padding: $pf-global--spacer--sm; | ||
$pf-chart-voronoi-flyout-stroke--Width: 1px; |
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.
$pf-chart-area-stroke--Width: 2px; | ||
|
||
// Axis Chart | ||
$pf-chart-axis-axis-stroke--Width: 1px; |
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.
why is axis
in the var name twice?
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.
|
||
// Box Plot Chart | ||
$pf-chart-boxplot-max--Padding: $pf-global--spacer--sm; | ||
$pf-chart-boxplot-max-stroke--Width: 1px; |
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.
Similar to my other comment https://github.com/patternfly/patternfly-next/pull/1863/files#r288707836
I think the prefix should be $pf-chart-global
or $pf-chart-boxplot
followed by --concept
(or thing you're styling) followed by --modifier
(if applicable), followed by --PropertyCamelCase
So this would become
$pf-chart-boxplot--max--stroke--Width
$pf-chart-boxplot--median--stroke--Width
$pf-chart-boxplot--min--stroke--Width
etc...
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.
Tried to follow this throughout the doc, but it would be great if you could double check the changes
$pf-chart-boxplot-min--Padding: $pf-global--spacer--sm; | ||
$pf-chart-boxplot-min-stroke--Width: 1px; | ||
$pf-chart-boxplot-q1--Padding: $pf-global--spacer--sm; | ||
$pf-chart-boxplot-q3--Padding: $pf-global--spacer--sm; |
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.
what do q1 and q3 represent?
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.
@gdoyle1 ?
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.
These are Victory BoxPlot component properties. You can read about them here: https://formidable.com/open-source/victory/docs/victory-box-plot#q1
|
||
// Bullet Chart | ||
$pf-chart-bullet--comparative-measure-line-warning--BorderColor: $pf-color-orange-300; | ||
$pf-chart-bullet--comparative-measure-line-warning--BorderWidth: 1px; |
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.
in this line and the ones below "warning" and "error" are states, so there should be 2 hyphens before that text.
$pf-chart-bullet--negative-primary-measure--BorderWidth: 2px; | ||
|
||
// Candlestick | ||
$pf-chart-candelstick-data-stroke--Width: 1px; |
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.
should this be $pf-chart-candelstick--data--stroke--Width
?
$pf-chart-chart--BorderWidth: 1px; | ||
|
||
// Donut Chart | ||
$pf-chart-donut-color-threshold-first: $pf-color-black-200; |
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.
Should this be $pf-chart-donut--threshold--first--Color
?
$pf-chart-tooltip--pointerLength: 10; // grayscale theme | ||
$pf-chart-tooltip--flyoutStyle--cornerRadius: 0; | ||
$pf-chart-tooltip--flyoutStyle--stroke--Width: 0; // this is 1 in grayscale theme | ||
$pf-chart-tooltip--flyoutStyle--pointerEvents: "none"; |
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.
pointer-events
is a property name, so you could call this PointerEvents
// Tooltip | ||
$pf-chart-tooltip--cornerRadius: 0; // this is 5 in grayscale theme | ||
$pf-chart-tooltip--pointerLength: 10; // grayscale theme | ||
$pf-chart-tooltip--flyoutStyle--cornerRadius: 0; |
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.
can we just hyphenate names that aren't CSS properties? so this would be corner-radius
. Also could we use BorderRadius
here?
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.
Updated all names that aren't CSS properties to have hyphens.
@dlabrecq do you know if corner radius and border radius are the same things?
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.
corner radius is different than border. For example, we want the cornerRadius=0 so our tooltip boxes look be square.
$pf-chart-tooltip--pointer--Height: 10; // this is equivalent to length | ||
$pf-chart-tooltip--pointer--Width: 20; | ||
$pf-chart-tooltip--Padding: 16; | ||
$pf-chart-tooltip--pointerEvents: "none"; |
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.
$pf-chart-tooltip--pointerEvents: "none"; | |
$pf-chart-tooltip--PointerEvents: "none"; |
$pf-chart-tooltip--Padding: 16; | ||
$pf-chart-tooltip--pointerEvents: "none"; | ||
$pf-chart-tooltip--labels--Padding: 5; // grayscale theme | ||
$pf-chart-tooltip--labels--pointerEvents: "none"; // grayscale theme |
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.
$pf-chart-tooltip--labels--pointerEvents: "none"; // grayscale theme | |
$pf-chart-tooltip--labels--PointerEvents: "none"; // grayscale theme |
$pf-chart-voronoi--data--stroke--Color: transparent; | ||
$pf-chart-voronoi--data--stroke--Width: 0; | ||
$pf-chart-voronoi--labels--Padding: 8; // this is 5 in grayscale theme | ||
$pf-chart-voronoi--labels--pointerEvents: "none"; |
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.
$pf-chart-voronoi--labels--pointerEvents: "none"; | |
$pf-chart-voronoi--labels--PointerEvents: "none"; |
$pf-chart-voronoi--labels--Padding: 8; // this is 5 in grayscale theme | ||
$pf-chart-voronoi--labels--pointerEvents: "none"; | ||
$pf-chart-voronoi--flyout--stroke--Width: 1; | ||
$pf-chart-voronoi--flyout--pointerEvents: "none"; |
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.
$pf-chart-voronoi--flyout--pointerEvents: "none"; | |
$pf-chart-voronoi--flyout--PointerEvents: "none"; |
$pf-chart-voronoi--flyout--pointerEvents: "none"; | ||
$pf-chart-voronoi--flyout--stroke--Color: "charcoal"; | ||
$pf-chart-voronoi--flyout--stroke--BackgroundColor: #f0f0f0; | ||
$pf-chart-voronoi--flyout--pointerEvents: "none"; |
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.
$pf-chart-voronoi--flyout--pointerEvents: "none"; | |
$pf-chart-voronoi--flyout--PointerEvents: "none"; |
$pf-chart-axis--grid--BackgroundColor: transparent; // is transparent ok for none? | ||
$pf-chart-axis--grid--stroke--Color: "blueGrey50"; // material theme | ||
$pf-chart-axis--grid--BorderColor: transparent; | ||
$pf-chart-axis--grid--pointerEvents: "painted"; |
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.
$pf-chart-axis--grid--pointerEvents: "painted"; | |
$pf-chart-axis--grid--PointerEvents: "painted"; |
@gdoyle1 there are two themes , one called grayscale and one called material. Right now we are relying on them so we want to use the same props that they include. Could you take a look at: https://github.com/FormidableLabs/victory/blob/master/packages/victory-core/src/victory-theme/grayscale.js and when you see the assignments at the top of the file could you take a look at these colors and let me know what they "should" represent in our color system.
I believe we will also need a conversion for the Material.js theme :) https://github.com/FormidableLabs/victory/blob/master/packages/victory-core/src/victory-theme/material.js |
$pf-chart-boxplot--min--Padding: 8; | ||
$pf-chart-boxplot--min--stroke--Width: 1; | ||
$pf-chart-boxplot--min--stroke--Color: "charcoal"; // grayscale theme | ||
$pf-chart-boxplot--q1--Padding: 8; |
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.
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.
q1 means Lower Quartile and q3 means Upper Quartile, basically the beginning and end of the median.
@christiemolloy Regarding the material color replacements, see here! |
@dlabrecq I'd like to review it again. I'll do that after lunch today. |
@@ -30,7 +30,7 @@ import docs from '../docs/code.md'; | |||
|
|||
export const Docs = docs; | |||
|
|||
export default (props) => { | |||
export default props => { |
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.
did you mean to commit this?
@redallen do you know if the parentheses are necessary? Looks like every component/layout has them except for
marvin:patternfly-next cmichael$ grep -ri 'export default' src/ | grep props | grep -v '(props)'
src//patternfly/components/Alert/examples/index.js:export default props => {
src//patternfly/components/AppLauncher/examples/index.js:export default props => {
src//patternfly/components/NotificationBadge/examples/index.js:export default props => {
src//patternfly/components/AlertGroup/examples/index.js:export default props => {
|
@dlabrecq could you provide some insight here. The layout vars are used in alot of charts right so they should stay global? or could it be moved to under the globals like the legend/axis? I think what @mcoker is saying is that we declare it at the top of the file but its not used in each chart type
|
@mcoker I hadn't done that yet because I wasn't sure how extensive the system will get. @gdoyle1 @dlabrecq do you know if we expect to add more colors to these fill colors or is this set ?
|
@mcoker I don't think 230 should be a variable because pies/donuts overlap anyway so that seems clear . |
@dlabrecq @gdoyle1 what do you think about using a spacer system here for padding? The values in the charts seem very much component specific, I can't see the use of a global spacer system here really. IMO I see a spacer system using a value set that has a pattern to how it increments.
|
Ah ok that makes sense.
I just mean that the width/height 230 pair is defined in 4 spots, so seems easier to maintain if that's a common var instead of hardcoded in each place, as long as we want those to display consistently. For example, this...
could become....
|
@christiemolloy Danger and error are the same, yes - I think more products are using "error" now instead of danger. I think a spacer system would be a good thing to look into making for charts. @mceledonia did you picture using the same number system as we have for our other spacers or a different incremental order? I'm not 100% sure about the colors thing although I don't see more colors being added to the chart colors. @mceledonia would you agree? |
@gdoyle1 yeah I think we can use the same spacer system. I used it when designing the charts, but I have a feeling it will really only come into play for padding of things like axis labels and such. Whether or not it makes sense on the dev side to do that, I'm not confident enough to give an answer there.. |
The 230px value is common to donut and donut utilization and donut threshold. However, they are separate components. I don't know that they should share a global variable simply because there is a similar value? Ideally, all components should have their own vars, but will defer to @mcoker. |
It's my understanding that the layout vars (font, family, etc.) are global because they are expected to remain consistent for all. Although, they're not necessarily used by all components; for example, legend, pie, tooltip -- maybe deeper in the style props? It's your call as to whether these particular vars are global. I don't feel strongly about the layout props, but padding may be specific to each component. In that case, we could override. I don't know if using a global spacer system here is best for charts. Although, perhaps we can speak more about what that means? We have specific 50px padding for the chart axis, while bar width is 10px. The legend also has a gutter of 20px, which probably should be 10px, IMO. Other than that, we have a few places where we use a padding of 8px (label margin) and 16px (legend margin). Forcing all that to fit in our spacer system may not be ideal? I'd be leery of changing any properties unless we see what it looks like in the charts, first. Due to the scale of the SVG, you may not get an exact pixel match (e.g., padAngle=1 looks a lot wider when rendered). |
$pf-chart-global--layout--Height and $pf-chart-global--layout--Width apply to all charts as a default height and width. However, donuts don't need to be that large, so we override that. I would like to continue with separate vars for padding/gutter and stroke/border width. Although they may share a similar value, these properties have very different effects on charts -- they are not the same. |
I think what you have now is fine. We use danger in the global color var names, which matches core. And I'm assuming the use of danger and error in the chart specific vars matches the theme properties.
Did you push those changes up? I don't see them.
👍 |
@christiemolloy lgtm! Looks like you missed one:
And I'm not sure what this is - would it apply as a stroke/border, too? Or is it something else?
|
Updated! $pf-chart-bullet--threshold-error--Width: 2; is just a width not a stroke or border. |
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.
Great work on this!!! 🎉
--pf-chart-line--data--Fill: #{$pf-chart-line--data--Fill}; | ||
--pf-chart-line--data--Opacity: #{$pf-chart-line--data--Opacity}; | ||
--pf-chart-line--data--stroke--Width: #{$pf-chart-line--data--stroke--Width}; | ||
--pf-chart-line--data--stroke--Color: #{$pf-chart-global--Fill--Color--900}; |
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.
--pf-chart-line--data--stroke--Color: #{$pf-chart-global--Fill--Color--900}; | |
--pf-chart-line--data--stroke--Color: #{$pf-chart-line--data--stroke--Color}; |
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 PR is included in version 2.14.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #1723
This Pull Request is for the remaining variables for Charts. I spoke to @dlabrecq and these vars should be specific to the chart variations which I followed here . @gdoyle1 could you review to check that I properly covered the variables here ?