This project is intended as a personal study of the D3.js svg-manipulation library. The Ui Percent Scaler is best demonstrated visually:
The value of each bar is a percentage of the sum of the range of each bar that is determined by a linear slope controlled by the Slope slider. The Element Count controls the amount of data points represented along the x-axis. The sum of all data points is equal to 100%.
The visualization is designed to be both desktop and mobile-friendly with responsive X-axis labels that adjust their orientation based on the viewport size.
There are two sub-directories. A Python version, and a beta vanilla js version.
-
Clone the repository :
git clone https://github.com/dv1651st/ui-percent-scaler
-
Navigate to the project directory :
cd ui-percent-scaler
-
Open
index.html
in a browser to view the visualization. -
Interact with Sliders : Use the provided sliders to adjust the element count and slope. The chart will update in real-time as you make changes.
- Use HTML for the x-axis labels instead of D3.js.
- Bring back the bottom border for the graph area.
- Make sure 50% on Slope slider translates to a horizontal slope across all values of Element Count.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.