Posts

Showing posts from April, 2023

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 ...