Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

primitives for VictoryBoxPlot #334

Merged
merged 10 commits into from
Mar 27, 2018
Merged

primitives for VictoryBoxPlot #334

merged 10 commits into from
Mar 27, 2018

Conversation

parkerziegler
Copy link
Contributor

@boygirl Sorry this is coming in late – I had an epiphany as I went to start this PR on Friday and wanted to get in some changes.

Purpose

This PR contains initial work for new primitive components to be introduced into victory-coreBox and Whisker. These components support the addition of VictoryBoxPlot in victory-chart (see the PR in victory-chart). These primitives are functional but by no means complete. More work needs to be done to ensure that they conform to the standards of other victory-core primitives. Tests also need to be written for these primitives. This branch should not be merged in its current state.

Component Structure

These primitives correspond specifically to different portions of the VictoryBoxPlot component.

Box

The Box component is intended to render a rect component for the first and third quartiles of VictoryBoxPlot (q1 and q3). It accepts simple positioning and layout props (x, y, width, height) in addition to CommonProps and a groupComponent prop. This is intended to make the component as flexible as possible, especially for reuse in a potential future library addition.

Whisker

The Whisker component is intended to render a "crosshair" representing the minimum and maximum values for each datum passed to VictoryBoxPlot (min and max). It accepts majorWhisker and minorWhisker objects as props, with majorWhisker referring to the line drawn from q1-min or q3-max and minorWhisker referring to the line drawn at min or max. These objects contain x1, x2, y1, y2, stroke, and strokeWidth props. stroke and strokeWidth correspond to the value of whiskerStyle passed by VictoryBoxPlot (this allows users to configure whisker styling directly via those props rather than via style).

Suggested Enhancements and Future Work

This component still requires several enhancements. These include:

  • Implementation of shouldComponentUpdate to reduce unnecessary re-renders.
  • Proper passage of a datum prop. This would be q1 or q3 for Box and min or max for Whisker when used with VictoryBoxPlot.
  • Proper passage of the style prop with evaluation using Helpers.evaluateStyle.
  • victory-native support.
  • Confirmation of proper interaction with events. As it stands, VictoryBoxPlot applies eventKeys to the entire data structure { _min, _max, _q1, _q3, _med }, meaning that individual box plot components do not currently have their own eventKeys.

@parkerziegler parkerziegler changed the title Initial work for primitives used in VictoryBoxPlot WiP: Initial work for primitives used in VictoryBoxPlot Jan 29, 2018
@boygirl boygirl merged commit 4b4f463 into master Mar 27, 2018
@boygirl boygirl deleted the feature/victory-boxplot branch March 27, 2018 16:56
@boygirl boygirl changed the title WiP: Initial work for primitives used in VictoryBoxPlot primitives for VictoryBoxPlot Mar 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants