Dojo Grid with large dataset(1m+) in FF - dojo

I have a grid that needs to show 1m+ records if necessary. The user may filter down if needed but the initial view will attempt to show a grid and associated scrollbar with 1 million or more rows. I am using dojo 1.4.3.
I have it set the grid up to use a QueryReadStore, and my grid config has rowsPerPage as the default 25. Autoheight is not being used, the height of the grid itself is static.
What ends up happening in FF8 is a blank grid renders after the data fetch. (edit: Following scientific notation tidbit is untrue, FF deals with this properly) It appears the problem occurs because the height is being set with scientific notation, so I'll see the div with class dojoxGridContent have a style="height: 3.2e+7px;width:6039px". I assume this is the result of 32 pixel rowheight multiplied by 1000000 rows. Even if this is fixed, setting the element height to 32 million results in a 0 height div. The limit appears to be somewhere between 17 and 18 million pixels for FF. Chrome's limit appears to be between 130 and 140 million. Didn't check what IE's is.
This blank grid behavior is not exhibited in IE or Chrome, because they neither return scientific notation values(edit: scientific notation seems ok) nor have such a low(?) element maximum height.
I can see a one solution that I'm not too sure how to implement, and that would be to fix the scientific notation pixels problem for FF(edit: This is not an issue, FF seems to be able to interpret this) and cap the 'numRows' attribute either at the store level or the server level to some value that will always result in a valid height based on browser and version.
Would love to hear other suggestions and any experiences others have had with large datasets and grids.

Related

ngx-charts-bar-vertical-2d minimum bar width

I would like to set the width of the bars to be a minimum of 12px. I would actually prefer to have a fixed width on the bars period.
As an example, when I am displaying 10 days of data, the graph looks fine, but for 30 days, it does not look good at all. Any thoughts on making this look better?
I added a horizontal scroll, but the width of the bars is automatically calculated based on the number of items in the graph, irrespective of the graph width. Is there any way to alter this behavior?
Screen capture: https://share.getcloudapp.com/yAubDN8X
Try adding [barPadding]="1" to ngx-charts-bar-vertical-2d element
<ngx-charts-bar-vertical-2d [barPadding]="1" ...>...</ngx-charts-bar-vertical-2d>
Try adding [groupPadding]="1" to ngx-charts-bar-vertical-2d element
<ngx-charts-bar-vertical-2d [groupPadding]="1" ...>...</ngx-charts-bar-vertical-2d>
as long as you minimize the padding between groups, the barWidth with grow automatically !

How do I change position offset of wheelnav.js spreader title text

I have failed after several attempts, and massive search attempts (which I may have just failed at), to determine how to move the text in the spreader title to accommodate use of the spreaderStartAngle and spreaderSliceAngle settings, which allow for changing the wheel to smaller sizes (180 or 90 degree versions in my case).
The demo on the site shows the text moving away from the center (starting as a 360 degree circle) down to a quadrant. But in my own use, the re-positioning does not occur automatically, and I see no additional attributes being applied that would cause this.
I have dived into more detail and found that there is apparently something in the Rafael library that may being modified (when looking at the source on the demo page), but it is beyond my understanding on how to approach this via the existing methods.
Anything I have tried makes no change to the text location, which is always centered in what would have been a full circle, regardless of the actual spreader's start and end.
You can position spreader's title via the spreaderPathCustom property.
wheel.spreaderPathCustom = spreaderPath().PieSpreaderCustomization();
wheel.spreaderPathCustom.titleRadiusPercent = 0.58;
wheel.spreaderPathCustom.titleSliceAnglePercent = 0.45;
PieSpreaderCustomization belongs to PieSpreader. The above values of titleRadiusPercent and titleSliceAnglePercent are suitable for 90 degree.

Is there a direct way to set wx.TextCtrl size by characters rather than pixels?

The constructor for wx.TextCtrl takes a wx.Size argument, which is in units of pixels. Usually, I don't want to specify the size of a multiline TextCtrl in pixels, but rather in how many characters it can show without scrolling. I find that multiline TextCtrls are often the dominant component in my windows, thus stretching by Sizer is not an option.
The wxPython Phoenix documentation contains a hint as to how to do this, however this is meant more for short text on single line control.
I have started using this utility method:
def _set_textctrl_size_by_chars(self, tc, w, h):
sz = tc.GetTextExtent('X')
sz = wx.Size(sz.x * w, sz.y * h)
tc.SetInitialSize(tc.GetSizeFromTextSize(sz))
along with code like this:
tc = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self._set_textctrl_size_by_chars(tc, 80, 20)
This works, but I consider it a hack. I have looked over the documentation but have not found any other way to do it.
I understand that fonts are not usually monospaced, and using 'X' as a representative character width is inexact, however it's plenty good enough for my usage. Still, it seems there should be some way to do this directly using the wx library.
Using something like text.GetSizeFromTextSize(text.GetTextExtent("99999").x) is indeed the best way to size the text control to fit exactly 5 digits (e.g. a ZIP code in some localities). Notice that this is slightly better than your code because the width of 80 "X"s is not necessarily quite the same as 80 times the width of a single "X". And I'd also recommend using "M" or "W" which can be noticeably wider than "X" in some fonts, but this is not going to changes matters much.
We thought about adding a helper method doing this and it might indeed be useful, but, again, this still won't make things as simple as you'd like because you really need to specify the characters you want to use: "W" for letters, "9" for digits and maybe something like "x" if you want the control to be wide enough to fit the given number of characters on average instead of being wide enough to guarantee fitting the given number of the widest characters because the difference may be noticeable.
The main place where we could make life simpler would be at XRC level and this would be worth doing ("just" a question of time...), but for the code I really don't think we can make things much simpler than what they're now.

Bootstrap3 row getting pushed to two lines

This is not exactly how my code is but for the sake of an example, I have a 3 column layout, first column being a col-md-3, and inside that I have 3 more columns, one which is col-md-1. However, because col-md-1 has a width of less than the padding (30px), the column to its right is now pushed to the second line.
to see my example, pull the divider until you are in desktop mode, and notice how the blue column is now on a separate line:
http://plnkr.co/edit/pQyjbrd7v4dWN4Ffkq9b?p=preview
Does this mean I can't have a column that small? I am coming from Bootstrap 2.x where the span1 had a width with a margin-left, so it used to work fine.
The short answer to your question is "Correct, can't have a column that small." You can't have a "1" sized column within a "3" side column for your purpose. The math is that the tiny column you're trying to display is only 2% (i.e., 8.3% of 25%) of the available page layout. On top of the Bootstrap 3 cols have a 15px left and right padding, which effectively wipes out that 2%. This is why you're seeing it wrap funny at anything less than about 1410 pixels, by my testing with your code. I don't know what you're trying to do, but the grid probably isn't the right way to do it for a so small a slice of the page.

size of node with shape=circle

i'm trying to set the size of the nodes this way:
controller[shape=circle,width=.5,label="Controller",style=filled,fillcolor="#8EC13A"];
But all three nodes are with different size. How can i set fixed size?
From the DOT Guide http://www.graphviz.org/pdf/dotguide.pdf on page 4 it says the following:
When drawn, a
node’s actual size is the greater of the requested size and the area needed for its text
label, unless fixedsize=true, in which case the width and height values
are enforced.
Thus you simply need to add fixedsize=true to your code