Skip to content

Commit 6c14263

Browse files
committed
restructure project
1 parent f0bb261 commit 6c14263

23 files changed

+3920
-36
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2024 dany laksono
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,32 @@ A GPU/Canvas hybrid Screen-Space Grid Aggregation library for MapLibre GL JS. Th
1919
```
2020
screengrid/
2121
├── src/
22-
│ └── screengrid.js # Main library file
23-
├── examples/
24-
│ ├── index.html # Full-featured demo
25-
│ ├── simple-test.html # Basic functionality test
26-
│ └── test.html # Original test file
22+
│ ├── index.js # Main entry point
23+
│ ├── ScreenGridLayerGL.js # Main orchestrator class
24+
│ ├── config/ConfigManager.js # Configuration management
25+
│ ├── core/ # Core business logic (pure)
26+
│ │ ├── Aggregator.js
27+
│ │ ├── Projector.js
28+
│ │ └── CellQueryEngine.js
29+
│ ├── canvas/ # Canvas rendering
30+
│ │ ├── CanvasManager.js
31+
│ │ └── Renderer.js
32+
│ ├── events/ # Event system
33+
│ │ ├── EventBinder.js
34+
│ │ └── EventHandlers.js
35+
│ └── glyphs/GlyphUtilities.js # Glyph drawing utilities
36+
├── dist/ # Built distribution files
2737
├── docs/
28-
│ ├── README.md # This file
29-
│ └── USAGE.md # Detailed usage guide
30-
├── assets/ # Static assets
38+
│ ├── ARCHITECTURE.md # Detailed architecture guide
39+
│ ├── USAGE.md # Detailed usage guide
40+
│ └── README.md
41+
├── examples/
42+
│ ├── index.html
43+
│ ├── simple-test.html
44+
│ └── test.html
3145
├── package.json
32-
└── server.py # Development server
46+
├── rollup.config.mjs
47+
└── server.py
3348
```
3449

3550
## 🚀 Quick Start
@@ -235,6 +250,15 @@ ScreenGridLayerGL.drawPieGlyph(ctx, x, y, values, radius, colors);
235250

236251
// Scatter plot glyph
237252
ScreenGridLayerGL.drawScatterGlyph(ctx, x, y, points, cellSize, color);
253+
254+
// Donut chart glyph (v2.0.0+)
255+
ScreenGridLayerGL.drawDonutGlyph(ctx, x, y, values, outerRadius, innerRadius, colors);
256+
257+
// Heatmap intensity glyph (v2.0.0+)
258+
ScreenGridLayerGL.drawHeatmapGlyph(ctx, x, y, radius, normalizedValue, colorScale);
259+
260+
// Radial bar chart glyph (v2.0.0+)
261+
ScreenGridLayerGL.drawRadialBarGlyph(ctx, x, y, values, maxValue, maxRadius, color);
238262
```
239263

240264
## 🐛 Troubleshooting
@@ -254,6 +278,10 @@ Enable debug logging by opening browser console. The library provides detailed l
254278
- Rendering process
255279
- Error states
256280

281+
## 👤 Author
282+
283+
**dany laksono**
284+
257285
## 📄 License
258286

259287
MIT License - see LICENSE file for details.
@@ -269,15 +297,23 @@ MIT License - see LICENSE file for details.
269297
## 📝 Changelog
270298

271299
### v2.0.0
300+
- **NEW**: Comprehensive modular refactoring (11 modules with clean separation of concerns)
301+
- **NEW**: Core modules for pure business logic (Aggregator, Projector, CellQueryEngine) - zero UI dependencies
302+
- **NEW**: Dedicated canvas management (CanvasManager, Renderer) - clean rendering pipeline
303+
- **NEW**: Organized event system (EventBinder, EventHandlers) - testable event logic
304+
- **NEW**: Configuration management system (ConfigManager)
272305
- **NEW**: Glyph drawing system with `onDrawCell` callback
273-
- **NEW**: Built-in glyph utilities (circle, bar chart, pie chart, scatter plot)
306+
- **NEW**: 7 built-in glyph utilities (circle, bar, pie, scatter, donut, heatmap, radial bar)
274307
- **NEW**: Enhanced aggregation storing raw data points per cell
275308
- **NEW**: Zoom-based cell size adjustment
276309
- **NEW**: Adaptive cell sizing options
277310
- **NEW**: Multi-attribute visualization support
311+
- **NEW**: Grid statistics method (`getStats()`)
312+
- **NEW**: Spatial query methods (`getCellsInBounds()`, `getCellsAboveThreshold()`)
278313
- **IMPROVED**: Enhanced cell interaction with detailed data access
279314
- **IMPROVED**: Better performance with optimized rendering pipeline
280-
- **IMPROVED**: Better folder structure and documentation
315+
- **IMPROVED**: Modular architecture enables better testing and reusability
316+
- **IMPROVED**: Comprehensive documentation with architecture guide
281317

282318
### v1.0.0
283319
- Initial release
@@ -286,29 +322,20 @@ MIT License - see LICENSE file for details.
286322
- Interactive hover and click events
287323
- Customizable styling options
288324

289-
## 🧪 CI/CD: Auto-publish to npm
290-
291-
This repository includes a GitHub Actions workflow that automatically publishes to npm when changes are pushed to the `main` branch and the version in `package.json` is higher than the version currently on npm.
292-
293-
### Setup
294-
295-
1. Create an npm token with publish rights: Settings → Access Tokens → Generate a new Classic token.
296-
2. In your GitHub repository settings, add a secret named `NPM_TOKEN` containing that token.
297-
3. Ensure `package.json` has correct `name`, `version`, `main/module/exports` fields and the project builds via `npm run build`.
298-
299-
### How it works
300325

301-
- On push to `main`, the workflow installs dependencies, builds, compares local `package.json` version with `npm view <name> version`, and publishes only if they differ.
302-
- Publishing uses provenance (`--provenance`) and requires Node 18+.
326+
## Future Plans
303327

304-
### Trigger manual publish
328+
### Short-term
329+
1. Add unit tests for each module
330+
2. Add integration tests
331+
3. Create CI/CD pipeline for testing
332+
4. Consider TypeScript definitions
305333

306-
- From the Actions tab, run the workflow via “Run workflow” (uses `workflow_dispatch`).
334+
### Long-term
335+
1. Plugin system for custom glyphs
336+
2. WebGL renderer alternative
337+
3. Server-side aggregation
338+
4. Framework bindings (React, Vue)
339+
5. Performance optimizations
307340

308-
### Versioning
309341

310-
- Bump versions using semver before merging to `main`:
311-
- Patch: `npm version patch`
312-
- Minor: `npm version minor`
313-
- Major: `npm version major`
314-
Commit and push the tag to trigger publish.

0 commit comments

Comments
 (0)