Skip to content
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

Update Dashboard UI #1002

Conversation

ctyrrellnrel
Copy link
Contributor

  • Very basic, just replaced normal details view of 'My distance' with chart,
  • next steps
    • switch 'details' view to a react component
    • create button to switch between chart and details view in 'my distance' card
    • Figure out why all data is showing up unlabled
    • Allow the axis to switch easily
      • right now, setting isHorizontal doesn't completely switch data, only thedirection of the bars
      • would be nice to flip data axis and bar axis simultaneously

- replaced normal details view of 'My distance' with chart
- next steps
    - create button to switch between chart and details view in 'my distance' card
    - Figure out why all data is showing up unlabled
    - Allow the axis to switch easily
        - right now, setting isHorizontal doesn't completely switch data, only thedirection of the bars
        - would be nice to flip data axis and bar axis simultaneously
@ctyrrellnrel
Copy link
Contributor Author

I will be adding images when I get farther in creating the component.

@ctyrrellnrel ctyrrellnrel changed the title Initial commit, just added chart Update Dashboard UI Jul 12, 2023
- one (MetricDetails) is going to be a copy of the original metric details view
- the next (MetricsCard) is going to be a container to have both the BarChart component, and the MetricDetails component
    - Will be a react component, rather than function, and will hold onto the state of whether or not the barchart or metricdetails will be showing

- next steps
    - add a button to switch between the two views
- allows the card to keep track of whether or not it has a BarChart or MetricDetails child component
- next step
    - Add button
- next step
    - format and style button
- button allows switching between the BarChart and the MetricDetails card
- button icon switches depending on the card represented
@ctyrrellnrel
Copy link
Contributor Author

Current State of PR

currently working to create react components for all of the cards, that include the new dashboard designs, to see if those work well.

  • Currently added (bottom dashboard)
    • Graph view
    • button that switches between graph view and 'details' view
  • To do
    • Add Better styling to card
    • Add the details view
    • Add bleeding edge / arrows to switch between cards
    • work on the graph view

Images

Screenshot 2023-07-12 at 2 19 15 AM Screenshot 2023-07-12 at 2 21 23 AM

This shows the ability to switch between views using the right button in the 'my distance' card

the styling is a bit funky right now, but will be solved later on

@JGreenlee
Copy link
Collaborator

Good progress! I'll review the code later

const { colors } = useTheme();
const [ numVisibleDatasets, setNumVisibleDatasets ] = useState(1);

const barChartRef = useRef<Chart>(null);

const defaultPalette = [
const defaultPalette = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid committing needless changes like this, where you add a space or adjust indentation

I know this was probably on accident - just make sure you check over the diff of what you're committing before you do so

'#80afad', // teal oklch(72% 0.05 192)
]
return (
<Card children={{}} style={{width:"90%", alignSelf:"center", height:"280px" }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to include children as a prop. I know VSCode probably yelled at you about it being missing.

As long as there are components nested inside you can ignore that warning. It's some issue with VSCode, Typescript, and React.

const { colors } = useTheme();
const [ numVisibleDatasets, setNumVisibleDatasets ] = useState(1);

const defaultPalette = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this was copied over from BarChart. It doesn't need to be here though

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to copy the contents of a file as a starting point for a new file, that's ok -- just make sure you remove the bits that aren't relevant.
we don't want unused code lying around

@ctyrrellnrel
Copy link
Contributor Author

we don't want unused code lying around

Alright, yeah I was planning on taking it out later, but I guess it's best to simply take it out immediately.

You don't have to include children as a prop. I know VSCode probably yelled at you about it being missing.

Also I saw that, good to know that it is not required, it seemed like a weird requirement to have.

- removed children property from card
- removed leftover code from copying from BarChart.tsx to MetricsCard and MetricDetails
- Removed unecessary import statements
@JGreenlee
Copy link
Collaborator

JGreenlee commented Jul 14, 2023

@ctyrrellnrel Some tips while you are working on these TODO items:

  • Add Better styling to card
  • If the current styling bugs you, go ahead; else I wouldn't stress too much about matching the existing style. Polishing aesthetics can be a later step; right now we just want to see more progress on the rewrite
  • Add the details view
  • At its core, this view is just going to be rows and columns. To achieve this, you can nest <View> components: define some row Views and put column Views inside the rows. Give each row flex: 1 if you want them equally spaced.
  • Add bleeding edge / arrows to switch between cards
  • work on the graph view
  • The graph view looks pretty ok as-is, but how about adding a button to toggle between "Individual" and "Population" stats? I think we still want this functionality.

-- also switched main-metrics html so that only the MetricsCard element is held in the ion-slide element, without any extra divs or headers
@shankari
Copy link
Contributor

shankari commented Sep 4, 2023

Closing this since it has been superceded by #1018

@shankari shankari closed this Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants