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

Move visualiser graph type default to a constant #2138

Merged
merged 2 commits into from
May 31, 2017

Conversation

daveFNbuck
Copy link
Contributor

Description

Refactors the way the visType default is handled so it's controlled by a constant defined at the top of visualiserApp.js

This also cleans up a few places where the default was being set
unnecessarily:

  • don't set it in html since we set it in javascript instantly anyway
  • remove code to set buttons to checked since this has no meaning

Motivation and Context

In my fork of Luigi, I use svg as the graph type default. This results in annoying merges when javascript related to handling the defaults changes. In order to make different defaults easier to maintain, this uses a constant in visualiserApp.js to determine which graph type is default rather than hard-coding it everywhere the default value is used.

Have you tested this? If so, how?

I ran it locally with both d3 and svg as defaults and tried loading pages. It seems to work.

In my fork of Luigi, I use svg as the graph type default. This results
in annoying merges when javascript related to handling the defaults
changes. In order to make different defaults easier to maintain, this
uses a constant in visualiserApp.js to determine which graph type is
default rather than hard-coding it everywhere the default value is used.

This also cleans up a few places where the default was being set
unnecessarily:
  - don't set it in html since we set it in javascript instantly anyway
  - remove code to set buttons to checked since this has no meaning
@mention-bot
Copy link

@daveFNbuck, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nmb10, @riga and @Tarrasch to be potential reviewers.

Before the previous commit, the graph type default was actually svg,
despite the d3 checkbox being checked by default. In order to keep more
consistent behavior, we should set the default graph type to svg.
@daveFNbuck
Copy link
Contributor Author

While working on #2139 I discovered that the current default graph type is actually svg, despite code that attempts to make it d3. It seems we default the radio buttons to d3 but the graph behavior to svg. To minimize the effects of this change on the end user, I've added a commit that changes the default to svg. These commits now combine to fix a bug where by default you have an svg graph showing under a clicked d3 button, and you can't click the already clicked d3 button to change it.

@daveFNbuck
Copy link
Contributor Author

Note: this failed travis due to a timeout. Nothing to do with this PR as it has no Python code changes.

@Tarrasch
Copy link
Contributor

Finally a red diff! :)

@Tarrasch Tarrasch merged commit 7ba57e6 into spotify:master May 31, 2017
@daveFNbuck daveFNbuck deleted the vistype_default_constant branch May 31, 2017 16:26
@daveFNbuck
Copy link
Contributor Author

Hopefully I'll be done with the javascript stuff soon and I can get back to red-heavy Python diffs :)

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