Dojo's OnDemandGrid and JsonRest Producing Erratic Order - json

I've been using dgrid's OnDemandGrid with dojo.store.JsonRest rather successfully after a bumpy start, but while implementing caching noticed a glitch: if I do a long swipe of my trackpad (i.e. I scroll rather unscientifically a "long way") and then scroll back, dgrid seems to become confused about where I am at. For example, say I am near row 1609 and then swipe down and find myself looking at row 500. If I then scroll back up towards the top, I'll find the id's of the rows may look something like this 1609, 1608, 1607, 503, 502, 501, 500... If I scroll downward father, it will pick up with the missing rows 499, 498, 497, 1606, 1605, etc.
var store = Observable(Cache(JsonRest({
target: "/cgi-bin/safari/safari_retrv.pl?action=front&format=json",
sortParam: "sort",
idProperty: "queryId"
}),Memory()));
var grid = new declare([OnDemandGrid, Keyboard, Selection, DijitRegistry])({
store: store,
query: {aid: "1604" },
bufferRows: 40,
loadingMessage: "Loading...",
columns: {
aid: "AID",
title: "Title",
poster: "Poster",
postTime: "Posting Date",
commentCount: "Comments"
},
}, "grid");
The problem occurs even if the store is just JsonRest without the Cache store.

Related

Autodesk Forge PDF Viewer and Measuring

I am working on an app that needs to calculate measures like areas and length etc. Lucky today by using Autodesk Forge viewer we can do that. I had looked into this blog post [enter link description here][1]
and as well to the docs [enter link description here][2]
[1]: https://aps.autodesk.com/blog/fast-pdf-viewingmarkup-inside-forge-viewer
[2]: https://aps.autodesk.com/en/docs/viewer/v7/reference/Extensions/MeasureExtension/
I am looking for a way to insert the measure values into my database, where I can view it again when I want or reload the page (not lose it) similarly with Markup with callouts and text.
Lastly, I am wondering about how much does it costs to translate the pdfs files using Forge?
thanks
You can retrieve the array with objects related with the measurements done with the line:
NOP_VIEWER.getExtension('Autodesk.Measure').measureTool.getMeasurementList()
You can store the result in your DB, together with viewstate and additional info such as urn and viewable guide.
To restore it, you can first activate the tool
NOP_VIEWER.getExtension('Autodesk.Measure').activate()
Then set the measurement list using the values you read from the DB
NOP_VIEWER.getExtension('Autodesk.Measure').measureTool.setMeasurements(listMeasurements)
Where listMeasurements will be something like:
var listMeasurements = [
{
angle: "0.0 °",
arc: "0.0 mm",
area: "0.0 mm²",
deltaX: "1569.7 mm",
deltaY: "6463.7 mm",
deltaZ: "162.0 mm",
distance: "6653.6 mm",
from: "Vertex",
location: "X: 0.0 mm\nY: 0.0 mm\nZ: 0.0 mm",
picks: [
{intersection: {x:43.5168342590332,y:-60.37924575805664,z: 8.858267784118652}, modelId: 2, viewportIndex2d: null, snapNode: 2587},
{intersection: {x: 38.367037573210276,y: -39.17272345572108,z: 8.32677173614502}, modelId: 2, viewportIndex2d: null, snapNode: 3521}
],
precision: 1,
text: "",
to: "Vertex",
type: "Distance",
unitType: "mm"
}
]
Now, you can deactivate it with one line of code
NOP_VIEWER.getExtension('Autodesk.Measure').deactivate()
Instead of using NOP_VIEWER, refer to your viewer instance through the variable defined in your code

renderAllRows: false still renders all rows

I am creating a table and have renderAllRows:false and it still renders all rows, giving me the 'performance tip:
*VM6606 handsontable.full.min.js:61 Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting the number of rendered rows by specifying the table height and/or turning off the "renderAllRows" option.
*
I don't know why it isn't working, and being a newbie at HOT, I don't know if placement is a problem, or some other issue. Any help appreciated.
My data set has 18k rows, so I would LOVE to disable it, but it doesn't seem to work.
any ideas why it doesn't work? Additionally, the readonly:true doesn't work either.
Here's the code:
HOT_prg_grp = new Handsontable(HOTcontainer, {
data: data_bucket,
renderAllRows: false,
columns: [{ type: 'text', readonly:true },
{ type: 'text', readonly:false }],
colHeaders: ["Program", "Group"] ,
afterChange: (changed) => {
changed?.forEach(([row, col, oldValue, newValue]) => {
var prg = HOT_prg_grp.getDataAtCell(row, 0);
chg = [prg, newValue];
changes.push(chg);
});
},
licenseKey :'blah blah'
});
}
I would expect the 'renderAllRows: false to work. also, renderAllRows: False fails.

Highchart/stockChart: Zoom with buttons into monthly-data and show affected columns

I have a simple time-series in highchart:
series: [{
"data": [[Date.UTC(2021,0,1), 22312], // January
[Date.UTC(2021,1,1), 12312], // Feburary
[Date.UTC(2021,2,1), 23322], // ... etc.
],
Now I want to zoom into one month, and show just one column with the given code:
rangeSelector: {
buttons: [{
text: '1m',
type: 'month',
count: 1, // This should show only 1 month, but it shows 2.
// If this is changed to "0", one month will be show, but
// The css "highcharts-button-pressed" is disabled, and you cannot
// see that "1m" was clicked.
},
According to documentation "rangeSelector.buttons.count" should span over an area of one month if type is "month" and count is "1". But what I´m getting here is a span over two months.
Here is an example:
https://jsfiddle.net/ds90vf5r/1/
Question 1: Why is higchart showing two columns instead of one when choosing/clicking on just 1-month (1m)?
Question 2: How can I zoom into the current date and show just one moth (or one column)?

Query all the users in a specific BIM 360 account

how can I get Query all the users in a specific BIM 360 account? with no limit, because I have over 100 users :
max limit means the limit of one page (the call of one time).e.g. if you set 50, then every call, 50 items only. By default offset = 0. It means starting with the first item. i.e. one call with limit=50&offset=0 will give you No. 0-49 items only.
one call with limit=50&offset=120 will give you No. 120-169 items only.
The response of the call will tell pagination info. e.g. when I set limit=2&offset=0. It tells total number of users is 10. The next page (nexturl) will be from No 2,3.
"pagination": {
"limit": 2,
"offset": 0,
"totalResults": 10,
"nextUrl": "https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-
5d39-43cb-b4c4-xxxxxx/users?limit=2&sort=name&offset=2"
},
If calling nexturl, it will tell the url of previous page(No 2,3 only) and next page (No 4,5 only).
"pagination": {
"limit": 2,
"offset": 2,
"totalResults": 10,
"nextUrl": "https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-
5d39-43cb-b4c4-xxxxxx/users?limit=2&offset=4&sort=name",
"previousUrl":
"https://developer.api.autodesk.com/bim360/admin/v1/projects/xxxxxx-5d39-43cb-b4c4-
xxxxxx/users?limit=2&offset=0&sort=name"
},
And my colleague Petr's sample will be also a good reference for coding.

amchart separate bullets individually

I am creating a simple time-based data plot using amcharts with has 5 values, its working great but every time there is 2 or more readings with the same value it stack up and only 1 bullet is visible, i tried to create a custom bullet but still no luck.
Is there a way to separate the bullets individually just to make it presentable.
Below is my code.
{
"bullet": "round",
"bulletBorderAlpha": 1,
"bulletColor": "#2980b9",
"bulletSize": 19,
"customBulletField": "bullet",
"id": "reading_4",
"lineThickness": 0,
"title": "reading_4",
"showHandOnHover": true,
"valueField": "column-8",
"balloonText": "<div style='margin:5px; font-size:12px;'>Reading 4: <b>[[value]]</b></div>",
"visibleInLegend": false,
},
Is there away to make it like below