Is there a good tool for programmatically creating diagrams? [closed] - diagram

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like a tool to create diagram in a programming language, maybe something like lua.
Is there any tool designed for that?

Yes, you can generate .dot files for Graphviz. Since these are text files, you can do it from any language. I wrote a post a while ago about auto-generating binary-tree diagrams from C code using Graphviz.

A little retro, perhaps, but there's always Pic. It outputs to .eps which can easily be converted to anything you want.
The input is a little old-school, but since it's all-text, it can be targetted by any language (even Lua) that has text output. Here's an example of a diagram of a data-structure.
.PS
boxwid = .5; boxht = .25
down
Base: box "base"
Used: box "used"
Max: box "max"
move to Base.e
move right
right
Mfile: box dashed wid 3 ht 5
move to Mfile.nw; move down .125
Mtab: right; box "nexttab"; box "nextent"
move to Mtab.sw; move down .25
Tab: right; box "adr0"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr1"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr2"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr3"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr4"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr5"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr6"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr7"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr8"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box invis "..."; box invis "..."; box invis "..."
move to Tab.sw; move down .25
Tab: right; box "adrN"; box "mark"; box "sz"
arrow from Base.e to Mfile.nw
arrow from Used.e to Tab.sw down .125
arrow from Max.e to Mfile.sw
.PE

Related

A question about theming of Plank dock - How do I give margin to the bottom of the dock

I have a question about Plank dock application.
As you know Plank supports theming via dock.theme and hover.theme files in .local/share/plank/themes folder. I am using all of its padding options like TopPadding, BottomPadding etc and they are working perfectly.
But how do I provide margin to Bottom? I don't want it to be stick to the Bottom and I want to move it to a little bit up so there will be space between bottom of the monitor and bottom of the Plank. Otherwise I can't provide full Round corners it looks just ugly.
Does anyone know how to move Plank on screen?

How can I stack editors vertically in Xcode 11?

The option to stack editors in Xcode 11 has been moved to Editor-Layout in the menu. However the three options Automatic/Editor on Left/Editor on Top are greyed out. How can I unlock this to arrange editors in a vertical stack?
TL;DR: In the top bar menu under View, click Change Editor Orientation.
Option #1: In the top bar menu under View, click Change Editor Orientation.
Option #2: In the File Navigator, press Command + Option + Control + T to open the currently highlighted file in an editor below the currently active editor. This orientation switches to horizontal if the Change Editor Orientation option was set.
Option #3: At the Open Quickly prompt (accessible by pressing Command + Shift + O), search for a file without pressing Return and, when a file is highlighted, press Option + Shift + Return. Use the arrow keys to specify where the new editor should be located.

Copy tooltip message into clipboard in Android Studio

In Android Studio, is there a setting I can enable that would let me do this?
Not intuitive at all, nevertheless:
1) click on the underlined word to show the tooltip:
The error will appear on the bottom bar.
2) Right click on that bar on the bottom:
The very important trick is to reach the bar with the mouse pointer without hovering on the 'Debug', 'TODO', 'Profiler', etc. buttons that are just above the bar we need to reach.

Add UIToolbar To Bottom of iOS 7 View

I have a UITabBar app that I build using xib in IB. In my view on IB, it has the bottom bar. In the following image, the bottom bar is just under the UIToolBar. It is under the toolbar, because I have no option to put it on top of the bar.
When I run the app, the toolbar appears in the middle of the screen as shown here. How can I fix that? I want it to be between the tab bar and the web view.
You need to set some Auto Layout constraints or an autoresizing mask in Interface Builder to tell your toolbar how to position itself.
Update: Assuming I understand what you're trying to do, try these constraints:
Web view: 0 distance from top and sides, (height of tab bar + toolbar) from bottom.
Toolbar: 0 distance from sides, default (or some constant) height, (height of tab bar) from bottom.
Tab bar: 0 distance from sides, default (or some constant) height, zero distance from bottom.

How to create a DHTML menu?

I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:
All items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Something like this:
+--------+--------+-------+---+---+
| Item 1 | Item 2 | Item 3| < | > |
+--------+--------+-------+---+---+
Menu items should be clickable anywhere in the cell. They should stretch both vertically and horizontally to the contents. The text in the items should be centered both vertically and horizontally. The menu should work in IE7/Opera/FF/Safari.
The scrolling is the easy part - I just place it all in a container (say, a <div>), set the container to overflow: hidden and then play around in Javascript with clientWidth, scrollWidth and scrollLeft. That I've figured out and have already tried.
But how to make the menu items so stretchy, clickable anywhere and centered text?
Try the CSS below:
#menu {
display: table;
}
#menu a {
display:table-cell;
vertical-align:middle;
}
And then format your menu like:
<div id="menu">
normal text
<big>large text</big>
<span style="line-height:100px;">very tall text</span>
</div>
This will force vertical alignment and prevent the links from wrapping. Let us know how it works out.
OK, I talked with my superiors and they decided that it might be OK that you cannot right-click a menu item and select "Open in New Window". If this requirement is dropped, then I'm not bound to <a> elements for links. With JavaScript I can turn anything into a link. Thus, I choose you, pikachoo <table>!
Yap, it's a heresy, but it works. More specifically, it's the only construct that I can think of that can do all of the following at the same time:
Center text horizontally and vertically;
Stretch to contents horizontally and vertically;
Not wrap to next line when items are starting to overflow.
Anything else that can do the same will probably be more convulted anyway. And before anyone has the idea - no, I don't need search engine support. It's an internal web application. It'd be pretty bad if Google could index that...
clickable anywhere is easy: you can either bind the onclick event trigger (and hopefully some cursor styling) to the atomic cell element, or you can make the atomic cell elements <a> tags (or more likely wrap these in <li>) and link and style appropriately (padding, margin, foo).
e.g. case 1:
<ul id="menu"><li class="item" onclick="foo()" style="cursor:pointer; cursor:hand; padding:1em; margin:1px; float: left;">FOO!</li></ul>
(obviously I don't really recommend inline styling or script handlers but you get the idea)
Applying padding will effectively centre the text, and having no width assigned they'll naturally stretch to fit their content.

Resources