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

Class hierarchy fix and naming consistency #11

Closed
wants to merge 20 commits into from
Closed

Class hierarchy fix and naming consistency #11

wants to merge 20 commits into from

Conversation

jimr
Copy link

@jimr jimr commented Jul 23, 2014

We now have BaseColumnsHighChartsView subclass HighChartsView rathern than JSONView and call the appropraite methods on the superclass for things like context data & plot options.

Also updated a bunch of class names as per issue #12 and generally tried to improve consistency everywhere.

James Rutherford and others added 2 commits July 23, 2014 14:37
We now subclass HighChartsView rathern than JSONView and call the
appropraite methods on the superclass for things like context data &
plot options.
@jimr jimr changed the title BaseColumnsHighChartsView class hierarchy fix Class hierarchy fix and naming consistency Jul 23, 2014
James Rutherford added 18 commits July 24, 2014 10:30
Mostly by making the base `get_context_data` do more work.
- Added a new chart type (area)
- PEP8 function naming (get_xAxis -> get_x_axis)
- Tidying in the base get_series method
- Base get_context_data now does more work
- added a 'chart_type' attribute
You can set the 'stacking' attribute on your chart class to be, e.g.
'percent' and the plot options will reflect this automatically. To do
this we needed to switch to using defaultdicts rather than plain dicts
and being a bit more careful in calling .update in subclasses.
Also return a defaultdict as the default y axis rather than None.
Moving towards a general approach of returning None from helpers to
prevent them from being inserted into the context data where the base
class can't meaningfully provide a default value (e.g. get_subtitle,
get_drilldown, etc). For helpers where subclasses might call super (e.g.
get_x_axis, we still return defualtdict objects.
Conflicts:
	chartjs/views/__init__.py
@jpic
Copy link

jpic commented Feb 6, 2017

Nobody would agree more with me about how much this would be necessary. However, we would like a more strategic way of doing so than breaking backward compatibility.

Could we have the renames and keep aliases/compatibility with the existing names ?

@jimr
Copy link
Author

jimr commented Feb 8, 2017

I admit, the scope of this work changed rather dramatically as we increased our usage. If it was up to me, I'd accept the changes and bump the major version of the library to indicate the API breakage... If that's not possible, it ought to be straightforward enough to add helpers to preserve the old behaviour.

@Natim
Copy link
Collaborator

Natim commented May 24, 2017

Can you fix the tests?

@jimr
Copy link
Author

jimr commented Jun 2, 2017

Are you interested in merging?

@marauder37
Copy link

It would be good to see this merged.

@Natim
Copy link
Collaborator

Natim commented Apr 18, 2018

@marauder37 would you like to take it over? Merge master, clean the tests and add backward incompatibility handling with DeprecationWarnings?

@Natim Natim closed this Jul 8, 2019
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.

None yet

4 participants