I am using Yfiles to to show the overview of the large Graph on the top left of the window. If the Graph is too big it is being cropped from the bottom in the overview div element. Any suggestions how we prevent the cropping of large graph from the overview component.
This indicates that either your content rectangle is not up to date (the overview always uses the contentRect to determine the bounds of the visible region in the overview), or your graph is that large that the minimumZoom property prevents the overview from not showing all contents: The default value is 0.0001, the enforced minimum 0.0000001, so you can try smaller values if your graph is really millions of units wide/high.
Related
I'm currently developing my own Metrics in Vega. Here is an example...
I am just using text marks, here is the source code for a very similar example to mine. In the example height and width are specified. However, I'm looking for the text to be autosized - that is, height and width are determined from the space the marks take up. The usual global setting to do this would be, autosize: pad or autosize: fit but these don't seem to correctly fit text marks on their own.
I'm reaching out to anyone who knows how to do this. Since I am using these in a Kibana dashboard, the autofitting would allow us to scale these metrics to any size we'd like, independent of any amount of text.
Many thanks.
To answer my own question,
I defined a 100x100 grid using scales and axes in Vega. And then plotted my words to fit inside this grid - since you can specify the x,y positions of the words.
After this the autofit applied correctly. I made sure to scale the fontsize (which is height of text in pixels) to the height of the panel (external signal).
Finally I had to hide the axes. So inside the axes I added this labels: false, domain: false. With a few extra additions this was my result. This is totally resizable within Kibana.
"A stackblitz is worth a thousand words": https://stackblitz.com/edit/angular-zoom-crop-marker
Basically what I'm trying to do is to have a square drawn above a certain position in an image (<img>), and have that dynamically adjust to the image while being zoomed in / out and cropped. The stackblitz link has 3 views, the basic view which is a plain image, a zoomable view (which I got working as well) and a view where the imaged is "zoomed in and cropped" while being zoomable - This is where I need your help.
Should I crop using object-fit in some way? Is it better if I use a canvas to handle this? I've been at this for a whole day I and I feel my css knowledge is too limited to pull this of.
Bonus question: How would I go about to have the zoom-in zoom-out buttons add/remove one image per row using only css flex-box? (ie: not statically adding x pixles in height and width, but rather increase or decrease the size of each image so that another image is removed or added (per row) while always filling up all the available space)
Thank you in advance!
Managed to solve it myself. stackblitz updated with a working solution.
pls check link. I want to set the plot height of all charts equally, how to do it?
link here: jsfiddle.net/doanvh/vqn24y5w/14/ (type http:// left link)
Image here
You can find the highest value of the height among all charts and based on the found value, modify the rest. I have modified your example a little bit by adding a function (look for the updatePlotHeights function between script tags, HTML tab) that performs a simple calculation that makes all charts' heights equal. Also I have decreased charts' widths in order for you to display them horizontally to compare them.
Example:
http://jsfiddle.net/BlackLabel/qbs6k3Lp/
I have built an automatic report in RMarkdown. The problem is that images in this report can have varying size and therefore the relative size of the element inside changes based on the number of items in the axis:
(ok in this case the two images are totally different but it is just to show what I mean)
Is there a way to fix only some parameters, like resolution, or just one dimension, let the other dimension to vary according to the elements in order to keep the element size fixed?
Thanks
I have 3 subviews(UILabel, UIImageview, UIButton) to be laid out on a container view. All the subviews are laid out using visual format language (VFL). The subview have padding from the leading , top edges etc. The content of the subview are dynamic so their sizes changes all the time. i want to resize the superview(container view) to exactly fit all the subviews. Is this possible by auto layout? i have seen some of the link here which suggest intrinsic size which i am not able to understand. can someone suggest a better way to achieve this.
Yes, it's possible. If you plan to resize the superview according to subview content, then intrinsic content size is the way to go.
The ever excellent Ray Wenderlich site has a tutorial that covers this well. It's Beginning Auto Layout in iOS 6: Part 2/2:
Intrinsic Content Size
Before Auto Layout, you always had to tell buttons and other controls
how big they should be, either by setting their frame or bounds
properties or by resizing them in Interface Builder. But it turns out
that most controls are perfectly capable of determining how much space
they need, based on their content.
A label knows how wide and tall it is because it knows the length of
the text that has been set on it, as well as the font size for that
text. Likewise for a button, which might combine the text with a
background image and some padding for the rounded corners.
The same is true for segmented controls, progress bars, and most other
controls, although some may only have a predetermined height but an
unknown width.
This is known as the intrinsic content size, and it is an important
concept in Auto Layout. You have already seen it in action with the
buttons. Auto Layout asks your controls how big they need to be and
lays out the screen based on that information.
It is possible.
In my case, I wanted to give rounded corners to segmented control. For that, I embedded segmented control in UIView. Now I was required to resize that container view as per size of segmented control.
I gave only following constraint and everything was taken care itself.
(1) Chose container view and give it X and Y constraints.
Leading space to Super view.
Top space to Super view.
(2) Chose container view and give Leading | Trailing | Top | Bottom constraint.
Leading space to segmented control.
Top space to segmented control.
Trailing space to segmented control.
Bottom space to segmented control.
(3) Chose segmented control and give it Height and Width constraints.
Height : 30 // Whatever
Width : 250 // Whatever
Now if I change the height and width of my segmented control, it automatically adjust container view's size (super-view of segmented control).