Connection between svg elements - svg

Is there a way to connect 2 elements in svg to achieve a "flow chart" like diagram? I have 2 boxes, an arrow between them, and I would like that if I drag one box, the arrow stays connected to the box.
I've founded that there is a spec for this feature in SVG 1.1 but is far from being completed.
I can't find any piece of code or library that does it (and I think it isn't a rare use case), and I would like to be sure that there isn't a proven way of doing it before I start making it myself.
Thanks!

You may be interested in the Dracula Graph Library which uses Raphael and does exactly what you mean:
http://www.graphdracula.net/
Update: I haven't used jquery-svg before, but I put something small together that may get you going: http://jsfiddle.net/7vJmy/2/
It takes advantage of jquery-ui draggable, but I suspect there's a nicer way to do it using the jquery.svganim.js package that's include with the library - anyway, this is all I have time for now.
Also, if you can in the future, include things like library restrictions in the question so you can get more specific answers from the get go! :) Hope that helps.

Related

styling TextInputLayout / TextInputEditText

I wanted to use the TextInputLayout/TextInputEditText in my app and was looking for ways to style this. Now there are lost of paged when you start googling on it but it also seems some thinks have changed in the current android version.
Do not misunderstand the pages where very usefull but did not supply a complete answer.
For that reason i am posting my end result here so others may benefit.
Before i explain in the answer below i want to thank Dmytro on his blog here as it was the most usefull.
The answer.
I made my example very colorfull to make it easier to understand.
To get to this result i used the following in my layout. sorry that it is not code but a picture but i did this so you can see the actual color and not just my name for it
Not a color thing, but as you can see i set the app:errorEnabled to true. this is done so the space needed for the error is already reserved which means your layout wil not rescale when there is an error.
the last thing you need it the border_color.xml:
Play around with the option to see what they do.
The only thing i did not manage to do in the layout is to change the color of the selectionHandles. I did find a code solution for it but...i'll keep looking.

Creating a floating menu that pops like normal menu but appears at mouse position

Some context
I've recently switched to ubuntu budgie (from unity), and I am really tired of the Plank/panel menu combo. I cannot find a setting that suits me, because depending on my screen setup, there's always something in the wrong place.
I am literally unable to show the menu on certain edges if I activate auto-hide, and if I don't activate it, it's not nice at all, to the point that I have removed the plank thing altogether. (Am I having strange bugs on this OS, or is it really messy?)
My idea
With great frustrations come new ideas. I thought again about one I had in the past. I would like to have a circle menu that pops around my mouse cursor when I press a given key combination (very much the kind of thing you would find in some games).
The main use case is to get "pined" application shortcuts easily when I need them, but perhaps other things would fit well with them (commands ...).
Questions
So my questions are:
Does such a thing already exist?
If it doesn't, is it difficult to realize? (How much time, complexity, ...)
What tools/libraries are needed for such a project? I know I'll find plenty of explanations on the gnome developer website but I could really use some more help.
Since you mention a buggy behaviour on Plank, depending on the screen configuration, I suspect you are suffering from this bug. In short: Plank's returned values for the space it needs are not always correct in multi monitor setup.
A neat option to replace at least part of the functionality is Ulauncher, by default called from a shortcut, but you could trigger it from anything that is capable of running its command.
Since Ulauncher's window simply identifies in the window list, you can easily write a script to move it to the current mouse position.
In case you'd need any help in that, just leave a comment.
Not sure if you are also referring to quick access of the window list, but for that you could use the Window Previews applet, or even the Workspace Overview applet, so life without Plank is possible.

Asciidoctor navigation bar

I see that asciidoctor.org itself has a navigation (top) bar. I'm guessing that the website was written using asciidoctor source files. Either way, how do I add a navigation bar using asciidoctor?
Update
This is possibly the wrong question to ask. Perhaps the right way to go is to use awestruct, Middleman, or Jekyll. Advice/suggestions are welcome.
Yes, the source is asciidoctor, but the site is using awestruct for the structure around the content. If you're looking at doing the same kind of thing, we recommend using some other site generation tool for the structure around the content.
Of course if you really want to do this in asciidoctor, you could. You'd need to create your own theme and craft the header that way, but it isn't really recommended because it ties your output to a medium.

Compiz-Snow Plug-In

Looks nice: http://www.youtube.com/watch?v=EtClcwRgJxU. How else can it be done?
If you are talking about X11, you can write a Composite Manager to achieve this. Your composite manager would probably want to realize these effects with OpenGL, for that the texture_from_pixmap plays an important rule.
You can start from these two keywords. It may be an option to not write the whole thing yourself but write a plugin to Compiz instead. Another keyword :)

Handwriting widget for iBooks Author

I am looking for a widget (HTML5, Dashcode, Javascript, whatever) that will allow the user of a textbook published from iBooks Author to use their finger or stylus to hand write notes within the textbook itself. I am not sure if it is even possible.
Many students like taking handwritten notes while reading and this functionality would be awesome. The comment note is nice but I have had students say they earn better when actually writing the information.
You may be able to embed and adapt this finger painting demo (live example) in javascript within an HTML widget. Or any equivalent 'touch drawing' code.
However I would really recommend to not even try to implement this as solutions like swipe make typing on devices about as fast as handwriting.

Resources