I am trying to determine which is the best arquitecture to my application, I am planning to use python, mysql, angular and flask as an intermediate between python and angular.

I have all the shots of basketball matches of different seasons whith the correspondant player, team, position, etc; and I want to plot them in a basketball court:


I want to add filters to this plot that for example I can select the team of the shooter, the player name, the team who was played against, the players of the other team, etc.

I was planning to have all the data in mysql, once I need it to export everything to a pandas dataframe and add some filters (widgets to plotly) to determine the previous items, and based on these filters to graph the shots missed and scored.

But now I am not sure which should be the best aproach, if the entire graph must be done in angular, with the filters and the satter plot whit the position, or if it is correct to do it in plotly in python, add the widgets in plotly and bring the data every time. My main doubt at this point can be summarized as where should I plot the scatter and the court, in angular and obtaining the values from flask, or it is correct to do it in plotly with the filters added? what is it the best advice considering that I am going to continue change the filters and obtaining new data?


I'd use the Plotly javascript directly in Angular, perhaps via the "plotly-angular.js" library. You could implement the UI tasks via RxJs, also in Angular. You don't really want to shuttle the UI settings, chart data etc between your frontend and backend: extra complexity, time lags, etc.

The remaining thing is storing/providing the data. If they aren't very complicated or huge, you might prefer some storage or database integration directly with Node/Angular. (Maybe even json files would be enough?)

Or a Python backend with an mysql could work better. Then you could have a simple REST + Flask integration. In any case, you'd want to keep presentational concerns from you backend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.