yFiles 2 : overlaping and resizing - graph

i try to use yFiles 2 to create a graph with multiple feature. Actually we have something witch work but we lot of behaviours overriding the yworks standard and we want better used it.
We 2 main feature witch cause problems :
no overlaping between our nodes.
a hierachy of node where parent element can be resized but when border intersect with child element we try (if no overlapping) to move it inside his parent.
The idea is too better integrate yworks to benefit standard feature. for example, use standard layout manager and not our one.
Today, we are overriding setSize and setLocation.
I think there is many way to do this. My ideas are :
use override HotSpotMode (updateNodeRealizerBounds) in EditMode.
or override the NodeLayout
Is it the good way ? Is there a better way ?
Thanks for any help!

Related

Vertical and horizontal CSS grid system

I want to start a blog design from scratch as a week-ends project, but I have problem to see how I can render it via CSS.
In a CSS grid system you can define the size of a column based on the number of elements e.g. I have 12 based grid and I can decide to have 2 columns: 2 of the size of 6 or one of 5 and one of 7.
[EDIT] I found a website example that does what I would like to achieve: http://www.by-form.net/
Thanks~
The thing about vertical sizing is that it should grow as your content grows, that's why grid systems only include rows with 12 columns, because you'll need your page to grow as the content in it does. As stated before (and I'm not sure if you meant pure CSS grid system when you asked or if you were referring to bootstraps grid system or something similar), you can use a lot of different frameworks to achieve this like Bootstrap or Materialize or even create one yourself (which is a great exercise if your objective is to understand how this works, but not so much if you want to be productive about your project).
Thank you for your answers guys,
I found 2 ways to answer that issue:
the masonry grid Javasript layout that handle very closely to the original idea of how I wanted to handle it.
or a nested grid (a grid within a grid), e.g. profoundgrid
I don't have much knowledge about this but using bootstrap css you can achive the grid system.
check this out
Your grid in the image is very complex.
I don't think you can achieve a layout like this without any rows or columns that is flexible enough.
What I mean by that is, that you surely want the boxes to grow when the content gets bigger. This could be a big problem cause there are so many dependencies to next and previous columns.
I wrote an answer to a similar question showing a variety of CSS Techniques to do layouts. Check it out, it might be helpful here.
Anyway, if you reduce some dependencies and know exactly what the order of the content should be and look like, it would be much easier.

Adobe: Edge Reflow how to use class instead of ID

I am using Adobe Edge Reflow and have made several designs using the software.
One thing I have found is that in the CSS exported, each element has its own ID in the stylesheet.
In many cases there are elements that should use classes but I see no way of doing this in Reflow.
For one website I made I went through manually changing this, but as you can imaging it took quite a while.
If anyone knows any way of using classes in Reflow or a better way of managing the exported style sheet I would greatly appreciate it.

Clearing pixels of font path in HTML <canvas>

I would like to know how I can create a colored canvas but with transparent parts with the font. I want the font to create a hole in this canvas. Is this possible and how ? My goal is to create the impression that an image is embbed in a font...
Thank you :)
<canvas> offers something called composite operations for cut off and such effects. I believe the operation you want is called destination out:
https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html
And here is some more technical details in the spec:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#compositing
I cannot provide you an actual working code (your use case is pretty rare), but you should be able find a globalComposite tutorials and with little playing with their code you can find out how to apply the operation for your case.

Flex Layout overview - any way to get a component's preferred size?

Is there a good place that has an overview of how Flex layout stuff is managed?
I'm trying to create some user-resizeable "windows" in Flex, but I'm having some trouble getting the layout calculations for the contents correct.
Right now I'm just trying to get a good understanding of how Flex calculates its layouts, but I haven't found any good overview documentation.
For instance, looking just at the width value there are the following:
minWidth
maxWidth
width
explicitMinWidth
explicitMaxWidth
explicitWidth
measuredMinWidth
measuredMaxWidth
measuredWidth
and the same set for height.
What's the meaning of each of these? How is each used? Is there any way using those to calculate some preferred size of a component (like getPreferredSize() in java)?
Answers to that specific width/height question would be very helpful, but if anyone knows of some good documentation that goes over Flex's layout stuff in general that would be great.
Chapter 6 of "Programming Flex 3" contains a detailed description of the Flex layout containers that I found very helpful.
Have a look at the measure() function of the component. (docs)
This is the function to override if you want to change its default sizing behaviour.
EDIT: Be aware, that each component usually overrides the measure() function of UIComponent, so there is no single place to understand the layouting of flex. UIComponent gives you a starter, shows how the engine roughly works, but each component has its own concreate way of guessing the expected size. It does a remarkable job in a vast number of cases, but it's not so easy to get into it, if the magic doesn't work for you.
I just read this article which covers layouts using Spark in a very clear language. It covers getPreferedWidth() and height specifically.
http://www.adobe.com/devnet/flex/articles/spark_layouts.html
The author's blog is very useful too.

Flex Button with one color on left & another on right

I have a Flex button. I need one color on the left and another on the right. I don't need it to be a gradient. Just solid colors. Like green on left & red on right. I really don't want to use an image -- just because it'll probably take me a long time to do it.
The gradients via Flex Properties in Flex Builder seems to apply only vertically, not horizontally.
I also tried to make 2 button, each half width (of original), and putting it into a HBox & really packing them close so they'll look like a single button with 2 colors. It works OK, but I was thinking if there was a better way.
Thanks.
I think the proper way to do something like this is to create a custom component and then override the drawing method and draw in two colors, with the associated properties and such.
The solution you used is the simplest, so you should keep it like that unless you want to go through the trouble of creating the custom component (It's not THAT bad since Flex is open source and you can see how the original button is coded, and modify from there).
you could use degrafa to skin the button
This link http://blog.timeister.com/2009/01/16/flex-custom-button-skin/ provides a nice way to do exactly what I wanted above. It needs 2 classes: one subclasses ButtonSkin & the other Button. Link them both via CSS and use them in mxml. Simple & easy.

Resources