Skip to content

Transforms #437

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

Merged
merged 5 commits into from
Mar 27, 2018
Merged

Transforms #437

merged 5 commits into from
Mar 27, 2018

Conversation

nicolaskruchten
Copy link
Contributor

@nicolaskruchten nicolaskruchten commented Mar 27, 2018

This PR roughs in the Aggregations UI but leaves the Panel in the Dev section of the app, as there are some issues in Plotly.react that will need to be resolved before it's usable. Partial fix for #306

@@ -59,7 +59,7 @@ class Section extends Component {
}
return (
<div className="section">
<SectionHeader name={this.props.name} />
{this.props.name && <SectionHeader name={this.props.name} />}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this turns Section into a slim container if no name is provided.

icon={icon}
label={addAction.label}
/>{' '}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this allows for dropdowns on +... needs better styling!

Copy link
Member

@bpostlethwaite bpostlethwaite Mar 27, 2018

Choose a reason for hiding this comment

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

Can you make an issue for this with a screenshot so @aulneau can apply his magic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes once merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

)
const mockName = this.state.mocks[mockIndex];
const prefix =
mockName[0] === '/'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this allows us to add local mocks on top of the remote ones.

'jagged ints': [2, 1, 3, 5, 4], // eslint-disable-line no-magic-numbers
ints: [1, 2, 3, 4, 5, 6], // eslint-disable-line no-magic-numbers
'jagged ints': [2, 1, 3, 5, 4, 6], // eslint-disable-line no-magic-numbers
'toggle ints': [1, -1, 1, -1, 1, -1], // eslint-disable-line no-magic-numbers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

helpful for aggregations and splits

@@ -4,9 +4,10 @@ import classnames from 'classnames';

export default class ModalBox extends Component {
render() {
const {backgroundDark, children, onClose} = this.props;
const {backgroundDark, children, onClose, relative} = this.props;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hack for PanelHeader modal styling

} else {
this.fullValue = this.props.fullValue;
}
this.srcAttr = props.attr + 'src';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bpostlethwaite please think on this part of the change... I'm not sure why the if was there before but I need to be able to write to srcAttr :)

Copy link
Member

Choose a reason for hiding this comment

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

Sorry @nicolaskruchten I can't remember for the life of me. It could have been necessary in some permutation of DataSelector but become unnecessary at some point.

We'll probably figure out why in a couple weeks...

}

return aggregations.map(({target}, i) => (
<AggregationSection show key={i} aggregationIndex={i}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NB this is a 'slim section' because it has no header!

@@ -31,7 +31,7 @@ export default function connectTraceToPlot(WrappedComponent) {

let fullTrace = {};
for (let i = 0; i < fullData.length; i++) {
if (trace.uid === fullData[i]._fullInput.uid) {
if (trace.uid === fullData[i]._fullInput._input.uid) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NB this allows us to get at the real input even if _fullInput doesn't have the same uid

Copy link
Contributor

Choose a reason for hiding this comment

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

should we put a comment in the code for that..?

Copy link
Member

Choose a reason for hiding this comment

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

@etpinard any issues you many be aware of with this type of check?

if (isNumeric(payload.transformIndex)) {
for (let i = 0; i < graphDiv.data.length; i++) {
if ((graphDiv.data[i].uid === payload.traceUid) !== -1) {
graphDiv.data[i].transforms.splice(payload.transformIndex, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

!== -1
....
I don't get it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, nice catch, that's me refactoring badly

{label: _('Min'), value: 'min'},
{label: _('Max'), value: 'max'},
{label: _('First'), value: 'first'},
{label: _('Last'), value: 'last'},
Copy link
Member

Choose a reason for hiding this comment

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

worth mapping over Plotly transform attributes so it is always in sync? Not a big deal I don't forsee them being updated often.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not compatible with localization...

@VeraZab
Copy link
Contributor

VeraZab commented Mar 27, 2018

ok, well, so this doesn't stale, I vote that we can merge it in as its in Dev panels, and continue building on this feature to finish it off, @bpostlethwaite ?

@bpostlethwaite
Copy link
Member

Yep looks great! 💃

@nicolaskruchten nicolaskruchten merged commit 188fc34 into master Mar 27, 2018
@nicolaskruchten nicolaskruchten deleted the transforms branch March 27, 2018 16:58
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