The Vega chart gallery has a wide collection of charts that you can copy-paste from.
The gallery current has:
gramex init
adds a login page, better default layouts, and an opinionated file
structure:
.editorconfig
, .eslintrc.js
, .flake8
, .stylelintrc.js
, .htmllintrc
.gitignore
, .gitlab-ci.yml
,README.md
favicon.ico
– the Gramex favicon is copied by default. Change itgramex.yaml
– enhanced for a template home page, login & logout pagesindex.html
– features a richer navbar, user info and dummy dashboardlogin.html
– a simple but fully featured login formtemplate-navbar.html
– a navbar template you can import in all pagesstyle.css
– all CSS for the app goes into this single file<appname>.py
– all Python code for the app goes into this single fileassets/
– a folder that contains non-version-controlled assets (e.g. img/
, data/
, fonts/
, etc.)js/
– common JS code across applicationserror/
– error handling templates.g1 0.12 supports template animation via virtualdom:
<script type="text/html" data-engine="vdom">
<div
class="red-ball"
style="transition: all 1s ease;margin-left:<%= x %>px"
></div>
</script>
<script>
var x = 300;
// Re-rendering the template just updates the changed styles / attributes.
// DOM elements are not deleted. Just updated.
setInterval(function () {
$('script[type="text/html"]').template({ x: x });
x = 300 - x;
}, 2000);
</script>
g1 0.12 supports search as you type:
<input
type="search"
data-search="@text"
data-bs-target=".list li"
data-hide-class="d-none"
/>
<ul class="list">
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
<script>
$("body").search();
</script>
Gramex UI components now use Bootstrap 4.2
instead of Bootstrap 4.1. This is backward compatible. It features
spinners,
switches,
toast notifications
and new utility classes like .font-weight-lighter
, .text-decoration-none
,
negative margins like .m-n3
, etc.
password:
.md
files nows uses the
toc
extension instead of the deprecated headerid
extension. This is mostly
backward-compatibleLocation:
headers with relative urls correctlyrequest
, current_user
, etc. in line with TornadoBaseHandler.auth
restricts usersTo upgrade Gramex, run:
pip install --verbose gramex==1.49
gramex setup --all # Set up UI components, puppeteer, etc