Posts

Cross-filtering Visualizations with Dash Plotly

Image
Many BI tools provide a features of cross-filtering widgets. This features enables widgets on a dashboard to respond to an interaction with one of the widget. When user clicks on a visualization, other widgets show the filtered data based on which category the user interacts with on the triggering widget.  It is a bit tricky to have this feature implemented with Dash Plotly. Here is a glimpse of what we will do with Dash Plotly: The code is available at github repo : https://github.com/dvinayakn/cross-filtering-visualizations-dash We will work with a fictitious data in csv file - sales_data.csv included in the assets folder. Here is a glimpse of the data: The code execution starts with index.py, where a Dash object is created and layout is assigned to the Dash object. The layout is defined in layout.py. The layout contains an html Div with below children: dcc.Store to contain sesssion id. dcc.Store to contain application data in memory. A reset button. Three visualizations indicati...

To Make Better Visualizations

Image
I am going to share some lessons I learned to make visualizations better, at least not making them confusing. Visualizations are powerful tools to make users look into your data. They help to find trends, anomalies, set goals, assess performance and what not. Visualizations posses all these virtues only when they are designed well.  Bar Charts Vs Pie Charts Human eyes and brains are evolved to better assess linear distances than angular. Hence, we can understand a bar chart better than a pie chart plotted on the same data. Look at the two visualizations below, which convey the same information: It becomes difficult for us to compare and infer from two sectors on pie chart even if they are adjacent. In above pie chart, all sectors look very similar, even if they are of different size. Look at the bar chart on the right, we can compare two bars even if the difference is very small - compare Product 4 (second bar) and Product 2 (third bar) in the bar chart. There is a difference of 3 ...

A Dash App With Visualization Interacting with AG Grid

Image
 Let's look at a simple Dash application which has a visualization controlling Dash AG Grid. We will have a bar graph as visualization and we will filter data in the AG Grid when any bar in the bar chart is clicked. Here is a glimpse of the app: The code for this sample application can be found at the public github repository -https://github.com/dvinayakn/interactive-visualization-ag-grid Here is the code structure of the application: Note that this application is not ready for deployment to Dash Enterprise. We will discuss that aspect in some other post. We have an "assets" folder where our sample data resides in the file - sales_data.csv inside the assets folder. Also, any javascript or css file placed inside the assets folder is directly accessible to the application. We have all our python code inside app.py for simplicity. In real world applications, the code is split into multiple python files and modules. We import the necessary packages for our application : from ...