set absolute position of element based on entire reveal slide using quarto - reveal.js

How do I set the absolute position of an element in a reveal-js slide based on the entire slide size?
When I try to add an element e.g. in the upper left corner of the slide the element appears upper left relative to the content.
E.g. "topleft" appears further upwards with this code
# testslide1
- 1
- 2
- 3
- 4
- 5
[topleft]{.absolute top="0%" left="0%"}
than with this code
# testslide2
[topleft]{.absolute top="0%" left="0%"}
while I expected it to have the same position

Related

ANSI control sequence: after setting line home and limit, how should cursor movements behave? which coordinates to use?

Context:
I'm working on a device which inserted between an electronic typewriter's controller and its keyboard turns it into a serial printer/terminal.
I want it to support some of the control sequences from ECMA-48 / ISO-6429 / ANSI X3.64. (also known as ANSI escape code)
I'm having some uncertainty if I'm understanding correctly the standard, so I would like to ask to know how it should be.
It's related to the commands SLH - SET LINE HOME and SLL - SET LINE LIMIT.
For example I could have the situation that I have 1/12 inch wide characters, I want a left margin of 1 inch, and 80 columns of text.
Then I would set page home to 13 and page limit to 92.
(since character positions are counted from 1, home is the first position, limit is the last)
So far ok.
But when I already have set the home, than how should the functions:
CHA - CURSOR CHARACTER ABSOLUTE
CUP - CURSOR POSITION
HPA - CHARACTER POSITION ABSOLUTE
CPR - ACTIVE POSITION REPORT
and others related to the cursor position work?
Should they use coordinates relative to to the actual edge, or to the home position.
So in my above example if I wanted to move to column 2 of the text print area (home being 13), I should use coordinate 2 or 14?
(similarly for vertical position and page home & limit)
My understanding is that these control sequences still use the absolute coordinates.
so in my example I would have to use coordinate 14.
Is this correct?
And if it is correct, this raises some additional problems:
I would have to know where the margins are to know which horizontal and vertical offset to use when moving the cursor to absolute positions.
If a program sets the margins first, then no problem, but I a program connects to the device and does not change the margins then it does not know the offset.
(There is a way, it could send a carriage return to move to the home position and then request the ACTIVE POSITION REPORT to discover the left margin position, but it does not look like a nice solution)
What should my device do if it is requested to move to a position outside the defined home and limit?
The standard says that beyond these limits no implicit movement should happen, but this is explicit movement.
If it receives a command to move to position 1 when the home is 13 what should it do? Move to 1? Move to 13? ignore?
When it is at position 15, home is at 13 and receives command to move cursor left by 4 positions should it move by 4 to 11? move by 2 to 13? ignore?
Another problem I see is that there is a command to set page home, and page limit, but not total page height.
It is only possible to select predefined formats by PFS - PAGE FORMAT SELECTION.
But I don't see a way to select any other height.
If I want to use continuous paper with 12 inch long pages (72 lines of text at 1/6 inch line height) connected together into a long tape then I see no way to define that height so that my device can correctly keep track of its positions on the following pages. Is there a way to do it?
Looks like I had to find the answers by myself.
question 0:
Yes, it appears, that the coordinates should still be absolute.
he standard says about character positions in a line and line positions in a page and these are specified in the beginning of the document and nowhere at all is said about it being relative. Looks like the only role of line home and limit is the place where CR (and some others) returns to, and limit of where implicit movement (like advancing forward after printing a character) can go, similar for page home and page limit.
question 1:
There is no easy way for a program to recognise where the home and limit positions are. As I mentioned, requesting ACTIVE POSITION REPORT can help if this is implemented. (my devece does not support it yet).
Anyway, many programs don't recognise the concept of line home, and assume that normal character positions start from 1.
My solution to this is that after power on, the line home IS exactly at position 1, and if you want something else, you have to specify it.
This way a program can safely make this assumption.
(However after the PFS - PAGE FORMAT SELECTION command I do set the line home to 1 inch as this is what the standard proposes)
question 2:
As above, the home and limit are only a margin for implicit movements. So the cursor movement commands will move outside these limits with no problem. Only the actual page size will limit them.
question 3:
(but I didn't give it a number when asked)
DTA - DIMENSION TEXT AREA is the command for this purpose. It specifies the size of the text area limited by the actual page size, not by the home and limit positions.

How to create flip panes in swift/ios

I am creating an app for my kid:
The image has 5 section, each in a different color. Each section has a black box on each side of the section.
What I want to do is when touching a black box in a section I want that section to vertical flip around and in the process of flipping I want the whole screen to follow flipping vertical to a new screen.
Ex) I press the left black box in green section. The green sections starts to vertical flip around (to the left or counter-clockwise) its axis in the middle of the section. And when it has flipped/turned some 10 degrees I want the rest of the sections to follow and when all sections has flipped a new all green page is shown.
I hope I made it clear what I want. Is this possible? How can it be done in Swift?
I have seen the vertical page flipper but I want a bit more stylish:). I have seen other samples with flipping an image, but not this two-part flipping.
Thanks to all clever people,
Micael

How to create non-stacked subbars chart using core-plot?

I need to display bar-chart diagram.
The main issue I've not found yet is how to display bars with sub-bars.
So the first bar consists of green bar (with 5 points for y) at bottom and yellow bar (with 3 points for y).
And the second bar consists of pink bar at bottom (with 3 points for y)
So my bars are not stacked. - I can have even no bars for next x, but I can have 3 sub-bars in one bar in different order.
Generally the following image shows what bars do I need.
Generally the following image shows what bars do I need.
Use a different bar plot for each fill pattern. Set barBasesVary to YES on each plot so you can control the ends of bars individually. The plot will query the datasource for three values for each bar: the location (the horizontal position for vertical bars), the tip (the top) value, and the base (the bottom) value. The "Vertical Bar Chart" demo in the Plot Gallery example app shows a simple example of this technique.

Autolayout - How to align with longest item

Suppose I have a view that contains two columns of objects. The first column contains labels, and the second column contains, say, sliders. I want the sliders all to align left with each other. I want the labels all to align left with each other. The trick is, how can I set the spacing between the labels and sliders so that the default spacing is used between the left sliders and the longest label, thus:
label 1 slider 1
label 2 slider 2
longer label 3 slider 3
very long label 4[]slider 4
label 5 slider 5
I've placed square brackets, [], where the default spacing should be. Is it possible to add this sort of constraint in the storyboard (iOS 7)? If so, how? The trick is that I don't know which label is the longest, especially with localization.
Ideally, I could specify a bounding box around the labels and align the sliders with the right side of the bounding box.
Yes, you can do this in IB. All the labels should have their left edges aligned, and one of them should have a fixed space to the left edge of their superview (all the elements should be enclosed in a UIView). Similarly, the sliders would have their right edges aligned and one of them would have a fixed space to the right edge of the box. Give one of the labels a horizontal spacing constraint to a slider -- make that a short one, say ==8 with a priority of 900 (that's the important thing). Now, give all the labels a >= constraint with whatever value you want for the minimum spacing (and leave the priority at 1000).

Jquery ui slider range - separate event for left and right draggers

I use many jQuery ui sliders as range sliders on one page. About 60 range sladers at one time.
Slider must do:
When i drag left dragger - right dragger must moove to. Its need for
fix range and moove it on max/min line
When i drag right dragger - left not moove, but change len of range used in #1 action
For store len of range i use attr in html:
div class="slider" range="10"
When i moove left dragger - i add range attr for calculate right
dragger position.
When i moove right dragger - i change range attr.
In javascript i use change and slide event - but i dont know left or right dragger create event.
How create separate events for left and right draggers in range slider?

Resources