g1 issueshttps://code.gramener.com/cto/g1/-/issues2022-11-07T09:16:25Zhttps://code.gramener.com/cto/g1/-/issues/141g1.types detects strings ending with space and then number as dates (not stri...2022-11-07T09:16:25ZTejeshg1.types detects strings ending with space and then number as dates (not strings)when you pass strings that end with space and number, when using `{convert: true}`.
```javascript
g1.types([{NAME: "Gramex 1"}], {convert: true})
{NAME: "date"}
```
Issue is with how `Date.parse` behaves.
```
Date.parse('Gramex 1')
978...when you pass strings that end with space and number, when using `{convert: true}`.
```javascript
g1.types([{NAME: "Gramex 1"}], {convert: true})
{NAME: "date"}
```
Issue is with how `Date.parse` behaves.
```
Date.parse('Gramex 1')
978287400000
```
raised by @pratap.vardhanS AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/132g1 $search configurable example documentation2022-11-07T09:16:17ZSundeep Reddy Mallug1 $search configurable example documentationg1 $search documentation released as part of 1.49 only points to fuzzy match feature. This issue calls out the need to extend the search capability by configuration (to accommodate additional logic) and share more examples.g1 $search documentation released as part of 1.49 only points to fuzzy match feature. This issue calls out the need to extend the search capability by configuration (to accommodate additional logic) and share more examples.S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/84Page refresh on selecting number of rows in FormHandler table2022-11-07T09:16:11ZNaveen ManukondaPage refresh on selecting number of rows in FormHandler table- When we select from new value from row dropdown page is completely refreshing.![image](/uploads/833eca55cc0ec8c1f333fab34cad79d1/image.png)
- Currently if we make size false we are showing all rows without pagination. We want to show p...- When we select from new value from row dropdown page is completely refreshing.![image](/uploads/833eca55cc0ec8c1f333fab34cad79d1/image.png)
- Currently if we make size false we are showing all rows without pagination. We want to show pagination with minimum size of 10 and hide rows dropdown.S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/77formhandler: Add .disable class to .count2022-11-07T09:16:05ZPratap Vardhanpratap.vardhan@gramener.comformhandler: Add .disable class to .countBy default total row `.count` adds a `span.btn` with `cursor: pointer`. Adding `.disable` class removes it.
There is no click behavior needed for that I suppose?By default total row `.count` adds a `span.btn` with `cursor: pointer`. Adding `.disable` class removes it.
There is no click behavior needed for that I suppose?S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/74Disable editing of primary key fields in formhandler table2022-11-07T09:15:59ZTejeshDisable editing of primary key fields in formhandler tableS AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/71formhandler should support groupby2022-11-07T09:15:53ZPratap Vardhanpratap.vardhan@gramener.comformhandler should support groupby### Summary
Gramex FormHandler now supports `_by`. See gramex#401
For GET requests, `?_by=State&_by=City` does the following:
- Group by State and City (in that order)
- Show sum of all numeric columns
- Show count of all non-numeric ...### Summary
Gramex FormHandler now supports `_by`. See gramex#401
For GET requests, `?_by=State&_by=City` does the following:
- Group by State and City (in that order)
- Show sum of all numeric columns
- Show count of all non-numeric columns (including date columns)
We need following options in formhandler table
- In column dropdowns to select that column has groupby key.
- Ability to hide certain aggregate columns
- Change aggregation type of the column
- Placeholder alongside pagination to list down dimensions and metrics.
### Benefits
This will allow users to create self-service explorations with formhandler interface.S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/69Allow custom classes on FormHandler table2022-11-07T09:15:47ZS AnandAllow custom classes on FormHandler tableAdding styles to FormHandler template components (table, count, page, size, export, filters, search, dropdown, ...) would be easier if we had a class element that we could add to each.
For example,
- [ ] `columns[..].classes`: add the ...Adding styles to FormHandler template components (table, count, page, size, export, filters, search, dropdown, ...) would be easier if we had a class element that we could add to each.
For example,
- [ ] `columns[..].classes`: add the classes to the specified column's `<td>`
- [ ] `tableClasses`: adds the classes mentioned to each table. Defaults to `"table table-sm table-striped"`
- [ ] `rowClass`: adds the classes to each row. Defaults to `""`S AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/34Create sanddance component - bar chart2022-11-07T09:15:39ZSundeep Reddy MalluCreate sanddance component - bar chartS AnandS Anandhttps://code.gramener.com/cto/g1/-/issues/32Create Gramex UI components2020-09-08T18:57:13ZS AnandCreate Gramex UI components# Dashboard ML
We want a markup language to define dashboards.
## It must extend HTML
For example:
```html
<div class="container">
<div class="g-filters">
- col type="date": Date
- col type="select": City
</div>
</div>
``...# Dashboard ML
We want a markup language to define dashboards.
## It must extend HTML
For example:
```html
<div class="container">
<div class="g-filters">
- col type="date": Date
- col type="select": City
</div>
</div>
```
This is like the web components approach. This will allow us to seamlessly mix HTML (which is fully extensible) and progressively add components.
## Each component may add additional CSS, JS, libraries
This should be a JavaScript library on npm that runs on the browser and node.js that manipulates the original HTML into a revised HTML (including CSS, JS).
The library controls the output of the entire page. Where required, it:
- adds links to JS / CSS / font / image / ... libraries
- adds snippets of HTML / CSS / JS at the appropriate locations
## This should include a Markdown component
For example:
```html
<div class="g-markdown">
# Heading
Text is unindented first.
```yaml
Code fences are supported
```
```vegam
// ... including arbitrary extensions
```
</div>
```
Another example:
```html
<div class="filters bg-white shadow pt-2 pb-2">
<div class="g-filters">
// example
[
{'on': 'filter-time', 'type': 'daterange'},
{'on': 'filter-status', 'type': 'select', 'name': 'status', 'value': 'Status'},
{'on': 'filter-users', 'type': 'select', 'name': 'user.id', 'value': 'User Name'},
{'on': 'filter-uri', 'type': 'select', 'name': 'uri', 'value': 'Page Name'},
{'on': 'filter-ip', 'type': 'select', 'name': 'ip', 'value': 'IP'}
]
</div>
</div>
```
## This should have a set of components we use in Gramex
- [ ] Markdown
- [ ] Filters
- [ ] Charts
Anything that can be done reasonably easily in Bootstrap is lower priority
## Next steps
Actions for @pratap.vardhan
- [ ] Define a spec for markdown, filters and charts Mon 2-Apr-2018
- [ ] Implement a prototype for all three Wed 4-Apr-2018 (assuming no Republic)
- [ ] Productionization https://code.gramener.com/cto/g1/-/issues/129g1.urlfilter does not work for checkboxes2020-06-22T08:16:39ZTejeshg1.urlfilter does not work for checkboxes```html
<li class="state_dropdown" filter-name="state_level" data-val="Odisha">
<label class="custom-control custom-checkbox h5 mb-0 text-nowrap cursor-pointer">
<input type="checkbox" class="custom-control-input urlfilter" d...```html
<li class="state_dropdown" filter-name="state_level" data-val="Odisha">
<label class="custom-control custom-checkbox h5 mb-0 text-nowrap cursor-pointer">
<input type="checkbox" class="custom-control-input urlfilter" data-mode="toggle" data-target="#" checked>
<span class="custom-control-label"></span>
<span class="custom-control-description sm2">Odisha</span>
</label>
</li>
```
is expected to update url and also, toggle the state of checkbox. It does neither.
g1.urlfilter's `e.preventDefault` intrudes bootstrap checkbox events.
Possible solutions:
Apply preventDefault only for anchor tags.
```js
if(e.target.tagName.toLowerCase() === 'a') {
e.preventDefault()
}
```
raised by @naveen.manukonda1.52TejeshTejesh2019-07-31https://code.gramener.com/cto/g1/-/issues/175FormHandler filters are not working with multiple tables in a single page2020-02-04T07:11:19ZBharat Rbharath.r@gramener.comFormHandler filters are not working with multiple tables in a single page**FormHandler filters are not working with multiple tables in a single page**
- When applying filters to one table it is applying to all tables by default
- And namespaces are applying only when the namespace is coming from the URL
**S...**FormHandler filters are not working with multiple tables in a single page**
- When applying filters to one table it is applying to all tables by default
- And namespaces are applying only when the namespace is coming from the URL
**Suggested FIX:**
- When a `namespace` is given to table any filter in the url should apply along with the `namespace`
For Ex.
```
$('.fh_table').formHandler({
namespace: 'name'
})
```
The url for the filters of the above snippet should be `?name:key=value`Bharat Rbharath.r@gramener.comBharat Rbharath.r@gramener.comhttps://code.gramener.com/cto/g1/-/issues/176add a new row with empty data for g1.formhandler2019-12-05T11:15:48ZPratap Vardhanpratap.vardhan@gramener.comadd a new row with empty data for g1.formhandler### Summary
We can't add a new row with empty data for g1.formhandler
### Steps to reproduce
- Create a csv with columns alone and hook it up with formhandler### Summary
We can't add a new row with empty data for g1.formhandler
### Steps to reproduce
- Create a csv with columns alone and hook it up with formhandlerhttps://code.gramener.com/cto/g1/-/issues/172G1.mapviewer does not support Ordinal scales correctly2019-07-31T21:17:11ZTejeshG1.mapviewer does not support Ordinal scales correctly`domain` gets calculated from
```js
MapViewer.prototype._calculateMinMax = function (layer, metricFormula) {
var minVal, maxVal
layer.eachLayer(function (sublayer) {
var metricVal = metricFormula(sublayer.feature.properties)
...`domain` gets calculated from
```js
MapViewer.prototype._calculateMinMax = function (layer, metricFormula) {
var minVal, maxVal
layer.eachLayer(function (sublayer) {
var metricVal = metricFormula(sublayer.feature.properties)
if (!metricVal) return
if (!(maxVal && minVal)) maxVal = metricVal, minVal = metricVal
if (metricVal < minVal) {
minVal = metricVal
}
if (metricVal > maxVal) {
maxVal = metricVal
}
})
return [minVal, maxVal]
}
```
This would return `[undefined, undefined]` incase the `metric` provided in the mapviewer options is Qualitative data.
Implications:
Even if `domain` is provided as array of unique categoricals and `range` as array of colors, the first color in range are already mapped to `undefined` value in domain. So, the domain mapping gets shifted by one place.
Possible Solutions:
Create a domain calculator module in G1, that can take a `accessor` as parameter. Such that the input can be array of objects (collections), or an array itself. In mapviewer case, the input is an array of `sublayer.feature.properties`.
This `g1.domain` will be reused in `g1.scales` module.
**Note for Tejesh**:
For discrete type scales (ordinal/band/point), if `domain` option is not provided and `metric` (Tejesh to make this as mandatory option) is provided, domain gets calculated internally irrespective of type of input data metric. If domain is provided but the provided domain does not span entire possible input values, discrete range values must be rotated after mapping provided domain values to discrete range.TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/171G1.mapviewer doesn't have an option to reverse the order of colorscheme2019-07-31T21:17:10ZPranav vadrevuG1.mapviewer doesn't have an option to reverse the order of colorscheme![image](/uploads/c2a46b4b895d74698ea2b56ac88a025b/image.png)
Cannot configure colorscheme to show red for higher values and green for lower values in g1 mapviewer for the scheme RdYlGn.![image](/uploads/c2a46b4b895d74698ea2b56ac88a025b/image.png)
Cannot configure colorscheme to show red for higher values and green for lower values in g1 mapviewer for the scheme RdYlGn.https://code.gramener.com/cto/g1/-/issues/65Scales.js: Is it possible to have discrete colour schemes, eg SchemeBlues[k] ...2019-07-31T21:17:10ZKarmanya AggarwalScales.js: Is it possible to have discrete colour schemes, eg SchemeBlues[k] for mapviewer```js
attrs: {
fillColor: { // Fill the regions
metric: 'loan_amount', // with the "score" column from state_score.json
range: 'RdYlGn', // using a RdYlGn gradient...```js
attrs: {
fillColor: { // Fill the regions
metric: 'loan_amount', // with the "score" column from state_score.json
range: 'RdYlGn', // using a RdYlGn gradient
scheme: 'schemeBlues',
scale: 'ordinal'
}}
```
Did not work, as line 58 of scale.js ``` result = d3['scale' + scale](d3[color]).domain(domain)``` doesn't let me use array notation.https://code.gramener.com/cto/g1/-/issues/174g1.formhandler editable table to support multi-select in dropdowns2019-07-31T08:51:03ZTejeshg1.formhandler editable table to support multi-select in dropdownsExpose option for more low level spec to support various third-party dropdown components.Expose option for more low level spec to support various third-party dropdown components.https://code.gramener.com/cto/g1/-/issues/82Create a dropdown component for filters2019-06-28T06:54:49ZS AnandCreate a dropdown component for filters- [x] Create a $.dropdown() that supports basic dropdown capability
- [x] Extend for multi-select
- [ ] Integrate with FilterHandler for multiple filters
- [ ] Integrate with FilterHandler for heirarchical filters- [x] Create a $.dropdown() that supports basic dropdown capability
- [x] Extend for multi-select
- [ ] Integrate with FilterHandler for multiple filters
- [ ] Integrate with FilterHandler for heirarchical filters1.51https://code.gramener.com/cto/g1/-/issues/173Move g1.formhandler table , g1.mapviewer modules into separate repos2019-06-26T01:52:32ZTejeshMove g1.formhandler table , g1.mapviewer modules into separate reposWe want to break up g1 into independent repositories. This will popularize g1 components because:
- People prefer libraries with a single purpose
- They are more likely to use it (and contribute back) since the learning curve is less
A...We want to break up g1 into independent repositories. This will popularize g1 components because:
- People prefer libraries with a single purpose
- They are more likely to use it (and contribute back) since the learning curve is less
Approach:
- `mapviewer`: mapviewer.js, leaflet-utils.js
- `urlfilter`: url.js, urlfilter.js, urlchange.js, ajaxchain.js
- `some template library`: template.js
- `sanddance`: sanddance.js
- `g1`: Gramex specific components:
- datafilter.js
- formhandler.js
- translate.js
- ... and other components which we may re-package later
- dropdown.js
- scale.js
- types.js
- highlight.js
- search.js
- fuzzysearch.js
- TODO: Find out how to handle dependencies, e.g. event.js.
Note: g1 will continue to import these libraries and function as before -- fully backward compatible.
### Approach for mapviewer
- Create a repo: github.com/gramener/mapviewer
- Create an npm package called [mapviewer](https://www.npmjs.com/package/mapviewer) via this repo. This should export an ES6 module (src/mapviewer.js) and UMD module (dist/mapviewer.js) via package.json
- Migrate test cases
- Refactor g1 to use import the mapviewer package as an ES6 module
https://code.gramener.com/cto/g1/-/issues/170Async sub-templates fail sometimes2019-06-04T04:23:11ZS AnandAsync sub-templates fail sometimes@tejesh.p please see https://code.gramener.com/cto/g1/-/jobs/115982
The test case related to "$().template() loaded static async sub templates" fails -- though it passes sometimes (on the server).
Maybe because we're checking before th...@tejesh.p please see https://code.gramener.com/cto/g1/-/jobs/115982
The test case related to "$().template() loaded static async sub templates" fails -- though it passes sometimes (on the server).
Maybe because we're checking before the sub-template has loaded? Could you please explore the test case?TejeshTejeshhttps://code.gramener.com/cto/g1/-/issues/169Template should allow access to source node2019-05-28T09:37:21ZS AnandTemplate should allow access to source nodeTemplates should support additional variables:
- `$this` accesses the jQuery template variable
- `$data` is a shortcut for `$this.data()`Templates should support additional variables:
- `$this` accesses the jQuery template variable
- `$data` is a shortcut for `$this.data()`1.56S AnandS Anand