gramex-ui
v0.0.1
Published
Gramex library
Downloads
2
Readme
Usage
First, read the documentation at https://learn.gramener.com/docs/g
You can install via:
npm install gmin
G.min.js
is bundled with Gramex 0.x. Add these lines to the
end of your code:
<script src="{{ static_url('/js/jquery2.min.js') }}">
<script src="{{ static_url('/js/G.min.js') }}">
NOTE: jQuery 2.0 or above is required to work with SVG elements.
Testing
Visit https://learn.gramener.com/docs/g.test/mocha/ to run unit tests. Or...
- Install nodejs. Note: On Cygwin, re-save the npm .sh files with UNIX line-endings
npm install -g uglify-js mocha
- Clone this repo and go to the
test
folder - Run a web server, e.g.
python -mSimpleHTTPServer
- Visit http://127.0.0.1:8888/mocha/
Selenium tests
The test/ui
folder has UI test cases. To run them, go to the test
folder
and run:
python -mSimpleHTTPServer
Then open ui/index.html
in Selenium IDE > File > Open Test Suite.
Interaction
- Click to filter
- TODO: Handle URL filtering for multiple values of the same key.
- Hover to highlight
- Search as you type
- TODO: debounce to be implemented
- TODO: search refresh event to be exposed
- Click to reveal
- Pan & Zoom
- TODO: smooth viewbox animation
- TODO: pinch to zoom on touch devices
- TODO: slide to pan on touch devices
- TODO: mousewheel to increase / decrease level of zoom on desktops
- TODO: hover to pan or drag to pan on desktops
- TODO: click on control to toggle zoom behaviour
- ZoomTo: Smoothly zoom to an element
- Brush to filter. (This is a 2D slider. With custom draggable handles, one can mimic horizontal sliders, vertical sliders AND rectangle selections. This will interact in exactly the same way that a rectangle in PowerPoint interacts.)
- Drag to re-position / re-size / rotate. Move / resize an element anywhere on the page, apply an arbitrary transformation, AND STORE IT
- Formula-based refresh of content / attributes, like AngularJS / MoneyFlicks
Layouts
- Preserve aspect ratio on resize
- Equal height columns
Components
- Slider.
- Timeline
- Loading indicator
- Dropdown
- TODO: Search as you type
- TODO: Multiselect
- TODO: Hierarchy
- TODO: Select all (clear all), Show selected (show all)
- Gradient picker
- Color picker
Common TODO
- If there is a clash, e.g. multiple highlights acting on the same element, how to resolve it?
- How should highlights be used as persistent filters across operations?
- Implement namespaces so that interactions can be toggled independently
- Events thrown by all of these
Publishing
To publish this on npm, run:
git push --follow-tags
npm publish # as sanand0