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

feat(flows): draggable visualizations #18486

Merged
merged 5 commits into from
Jun 12, 2020
Merged

Conversation

alexpaxton
Copy link
Contributor

@alexpaxton alexpaxton commented Jun 12, 2020

  • Make Resizer and ResizerHandle into generic components and move to notebooks/shared/
  • Implement resizing on Visualization panels

Screen Shot 2020-06-12 at 10 10 31 AM
Screen Shot 2020-06-12 at 10 10 38 AM
Screen Shot 2020-06-12 at 10 10 47 AM

Visualization without data:
Screen Shot 2020-06-12 at 10 10 59 AM

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@alexpaxton alexpaxton requested a review from drdelambre June 12, 2020 17:13
register({
type: 'query',
component: View,
button: 'Custom Script',
initial: {
resultsVisibility: 'visible',
resultsPanelHeight: 200,
panelVisibility: 'visible',
Copy link
Contributor

Choose a reason for hiding this comment

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

this resizing is a weird concept in here. like, is it notebook specific? but it's not shared by all panels... and a panel in the query context is a child of the notebook panel, but in a visualization, it's the panel itself? most of my hangups come from not having a set of clear definitions around this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same same. I briefly considered moving it into meta or even its own context but did not because only some types would use it

resizingEnabled={!!results.raw}
emptyText="No data to visualize"
emptyIcon={IconFont.BarChart}
toggleVisibilityEnabled={false}
Copy link
Contributor

Choose a reason for hiding this comment

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

dope

/** When resizing is enabled the panel cannot be resized below this amount */
minimumHeight?: number
/** Renders this element beneath the visibility toggle in the header */
additionalControls?: JSX.Element | JSX.Element[]
Copy link
Contributor

Choose a reason for hiding this comment

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

the idea being we're gonna add a gear icon for view options? it be better to have a more rigid interface description here if that's the case. like an array of "icon, enabled, onclick, hover text" if it's just all going to be the same buttons, with small differences?

<div className="panel-resizer">
<ResizerHeader
emptyIcon={emptyIcon}
visibility={visibility}
Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't be passed down

Copy link
Contributor

Choose a reason for hiding this comment

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

note: this is going to be addressed in a clean up pass when adding the "CurrentPipe" context

<ResizerHeader
emptyIcon={emptyIcon}
visibility={visibility}
onStartDrag={handleMouseDown}
Copy link
Contributor

Choose a reason for hiding this comment

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

why handle the drag logic here, and not in the child component?

dragHandleRef={dragHandleRef}
resizingEnabled={resizingEnabled}
additionalControls={additionalControls}
onUpdateVisibility={handleUpdateVisibility}
Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't be passed down

Copy link
Contributor

Choose a reason for hiding this comment

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

note: this is going to be addressed in a clean up pass when adding the "CurrentPipe" context

@drdelambre
Copy link
Contributor

there's a lot of prop drilling going on, can we tighten that up? would it also help if we created a "CurrentPipe" context and provider for all of the NotebookPipes? then we can decouple that drilling even more be removing the "data/onUpdate" props

Copy link
Contributor

@drdelambre drdelambre left a comment

Choose a reason for hiding this comment

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

NOTE: there's a bit of tech debt in here around prop drilling, but we have a fix in mind and still can't properly scope the scale of it yet, so we're pushing it off to next week

@alexpaxton alexpaxton merged commit 2642344 into master Jun 12, 2020
@alexpaxton alexpaxton deleted the feat/draggable-visualizations branch June 12, 2020 21:18
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.

2 participants