I need to rotate this Icicle to a vertical(up-down) way: https://observablehq.co m/@d3/zoomable-icicle. The first screen option works but when I clicked the item, it fails. The following changes work: - .attr("transform", d => "translate(" + d.target.x0 + "," + d.target.y0 + ")");
-
-
.attr("width", d => d.x1 - d.x0 - 1)
-
.attr("height", d => rectHeight(d))
-
-
function rectHeight(d) {
-
return d.y1 - d.y0 - Math.min(1, (d.y1 - d.y0) / 2);
-
}
The function that fails is: - function clicked(p) { focus = focus === p ? p = p.parent : p;
-
-
root.each(d => d.target = {
-
x0: (d.x0 - p.x0) / (p.x1 - p.x0) * height,
-
x1: (d.x1 - p.x0) / (p.x1 - p.x0) * height,
-
y0: d.y0 - p.y0,
-
y1: d.y1 - p.y0
-
});
-
-
const t = cell.transition().duration(750)
-
.attr("transform", d => "translate(" + d.target.x0 + "," + d.target.y0 + ")");
-
rect.transition(t).attr("height", d => rectHeight(d.target));
-
text.transition(t).attr("fill-opacity", d => +labelVisible(d.target));
-
tspan.transition(t).attr("fill-opacity", d => labelVisible(d.target) * 0.7);
-
}
What I have tried:
Changing x for y - x1: (d.x0 - p.x0) / (p.x1 - p.x0) * height,
-
x0: (d.x1 - p.x0) / (p.x1 - p.x0) * height,
-
y1: d.y0 - p.y0,
-
y0: d.y1 - p.y0
-
-
const t = cell.transition().duration(750)
-
.attr("transform", d => "translate(" + d.target.y0 + "," + d.target.x0 + ")");
-
rect.transition(t).attr("height", d => rectHeight(d.target));
-
text.transition(t).attr("fill-opacity", d => +labelVisible(d.target));
-
tspan.transition(t).attr("fill-opacity", d => labelVisible(d.target) * 0.7);
-
}
I also tried replacing height to width - y1: (d.y0 - p.y0) / (p.y1 - p.y0) * width,
-
y0: (d.y1 - p.y0) / (p.y1 - p.y0) * width,
-
x1: d.x0 - p.x0,
-
x0: d.x1 - p.x0
0 4760 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Showjumper |
last post by:
Hi,
I have developed an upload server controls to be reused over a number of
projects. One of the tasks it needs to handle is to rotate an image. I want
to accoplish this by checking the checkbox that is next to the file field.
Once i browse for the file, i check the box to rotate and then upload.
However i am unable to get it to rotate when the box is checked. It only
rotates when i set a boolean (RotateImage) to true. Any ideas on how to...
|
by: byrd48 |
last post by:
Hi,
I am developing a web site which allows users to upload and share
photos. I have a datalist which lists the photos and has the usual
edit, update commands.
Within the edititemtemplate, I have links to allow the user to rotate
the photo 90 degrees left or right. After I rebind the datalist,the
photo is not rotated on the web page, although it correctly rotated on
the server. If I click refresh, it updates, but calling refresh causes...
|
by: Peter Proost |
last post by:
Hi group,
I got the following piece of code which draws a square with stars round it,
now I want the stars to rotate round the square, I can do this with the
mx.rotate and a timer and an angle, but this rotates the whole drawing of
the stars but what I realy want is for the stars to rotate round it's center
point, is this possible? I hope I was clear enough in my explanation.
Thanks in advance
|
by: santel_helvis |
last post by:
Hi All,
Could anyone tell me how to rotate the image in javascript. Which
concepts I should concentrate to rotate the image
|
by: iwdu15 |
last post by:
hi, im trying to rotate a gdi drawn object on my form with a
keypress....forinstance when i push the down arrow, for it to rotate the
object drawn until the top is down, or if i push the right arrow key, to
rotate the object until its pointed to the right. i tried using a drawing
matrix to accomplish this, but all it did was rotate my entire form (im
drawing my object on the back of the form) and thats not what i need. I need
it to rotate...
| |
by: lovecreatesbeauty |
last post by:
I write a function to rotate a matrix by 90 degrees clockwise, this
function works on a matrix of specific size, for example, it rotates a
4*4 matrix of integers in the following code. The function makes one
more copy of the original matrix, how is the efficiency? Can the copy
be saved? Comments on it are welcome.
Can I extend it to work on a matrix of any size (or even any type, not
just integers) for the logic may be the same when it...
|
by: RC |
last post by:
First, this is a SVG issue, not 100% of XML issue. But I can't find
SVG group to post this. Since SVG is XML file, I post here hopefully
someone know both SVG and XML can help.
Here is my SVG lines
line.blue {stroke:blue;stroke-width:3;}
line.bluedash {stroke:blue;stroke-width:1;stroke-dasharray: 9,5;}
<defs>
|
by: Samuel Shulman |
last post by:
Is it possible and how to rotate pictures in HTML document
Thank you,
Samuel
|
by: Joey_Stacks |
last post by:
Does anyone know of a scipt that will rotate random div layers on page
refresh? I have a primary content area front and center on my site
homepage, and I'd like to rotate various chunks of html (in div
layers) each time a user reloads the page. Right now I'm resorting to
a random image rotation (those scripts are a dime a dozen) on refresh,
but it's far from ideal for what I'm trying to accomplish. Any help
on this would be GREATLY...
|
by: Dariusz.Donimirski |
last post by:
I must rotate bmp using Xlib without change bmp's memory. If someone
knows how I can do this, please help me.
dariusz
sorry about my english, I'm still learning
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |