-
Notifications
You must be signed in to change notification settings - Fork 157
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
Consolidate charts #114
Consolidate charts #114
Conversation
07a8966
to
98de3e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on consolidating the components.
I see you also upgraded the sample projects nugets which is nice but not really in the scope of this PR.
However, this PR does way too many other things. There's no need to refactor/reformat code outside of the samples and the chart components. Also it edits tons of files by just removing unnecessary usings; this really shouldn't be done here. I don't think it makes sense to merge it like this.
The rest is highlighted by comments.
...s/Shared/ChartJs.Blazor.Sample.Shared/Components/BarCharts/HorizontalBarChartComponent.razor
Outdated
Show resolved
Hide resolved
samples/Shared/ChartJs.Blazor.Sample.Shared/Components/BarCharts/SimpleBarChartComponent.razor
Outdated
Show resolved
Hide resolved
samples/Shared/ChartJs.Blazor.Sample.Shared/Components/LineChart/LinearLineChartComponent.razor
Outdated
Show resolved
Hide resolved
samples/Shared/ChartJs.Blazor.Sample.Shared/Components/RadarChartComponent.razor
Outdated
Show resolved
Hide resolved
ba1d4d0
to
02c083a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
If it was me, I would nitpick those few indentation-inconsistencies that razor markup regularly messed up (for example the starting braces of collection-initializers is a razor favorite) and put some additional effort into the xml-comments on Chart
.
Only two questions but they can both be addressed later so I'll approve this already.
- Would you consider removing the
.Charts
namespace and haveChart
be top-level soChartJs.Blazor.Chart
? Plays into Use of ChartJs.Blazor outside Razor/Blazor #78. - Do we need the
_ViewImports.razor
file in theCharts
directory? As far as I'm concerned (tested it quickly), this is not needed.
I fixed a couple of indentation issues and removed the _ViewImports file. Regarding the namespace suggestion: There are multiple issues with the file structure right now. For example After I've reorganized that it will become clearer where the new |
samples/Shared/ChartJs.Blazor.Sample.Shared/Components/BarCharts/StackedBarChartComponent.razor
Outdated
Show resolved
Hide resolved
Great! It would be nice to have the indentation fix in the "update samples" commit, consider doing that before merging. Regarding your comments about the namespaces, I have a few suggestions.
|
Regarding the namespaces, I disagree. The #78 is very desirable, but we've got a long way to go until we can tackle it. It is premature to guide our current decisions on that |
I think our disagreement stems from the fact that the interop consists of two parts. One part is the interop to activate and update the chart and I 100% agree with you there, that shouldn't be exposed to the user (that's why Regarding |
I think we mostly agree. The callbacks should be moved together into a namespace that has nothing to do with interop. in my opinion this discussion about the namespace is totally misplaced here and I suggest we don't continue it. |
52952d3
to
32a8fa4
Compare
32a8fa4
to
3b57fe6
Compare
I still strongly disagree on moving |
Removed the subclasses of
ChartBase
and renamedChartBase
toChart
.The old way of creating a chart:
becomes:
This should make it easier to use charts since you don't need to know about each chart type and its Configuration type.
Note: for the moment you need to explicitly specify
TConfig
, but the Blazor team works on the possibility to infer that from theConfig
instance so in the future you can leave it out.