scale

D3.js using ordinal scale over linear scale

女生的网名这么多〃 提交于 2019-12-10 16:40:06
问题 Why is it better to use this instead of a linear scale for making an ordered bar chat? The argument that I've heard is that this can keep the data sets in order, but can't this also be done if one sets the index number of the individual data as the x-coordinate? dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13]; var xScale = d3.scale.ordinal() .domain(d3.range(dataset.length)) 回答1: The reason you should use an ordinal scale instead of a linear scale is simple, although a lot of people get

JavaFX How do I scale the coordinates of a Path without altering the line width?

微笑、不失礼 提交于 2019-12-10 16:36:05
问题 I am currently working on a step line chart with a zoom and panning functionality. Since the amount of data I need to process is pretty large, i can not afford to recreate the whole path of the step line, every time layoutPlotChildren() is called. So my idea was to create the path element once and just transform it on zoom an pan events. So far everything worked out as planned, but i am having a big problem when I'm trying to scale the path. Since the Path class is inherited from Shape,

Division in c# not going the way I expect

£可爱£侵袭症+ 提交于 2019-12-10 15:21:22
问题 Im trying to write something to get my images to show correctly. I have 2 numbers "breedtePlaatje" and "hoogtePlaatje". When i load those 2 vars with the values i get back "800" and "500" i expect "verH" to be (500 / 800) = 0,625. Tho the value of verH = 0.. This is the code: int breedtePlaatje = Convert.ToInt32(imagefield.Width); int hoogtePlaatje = Convert.ToInt32(imagefield.Height); //Uitgaan van breedte plaatje if (breedtePlaatje > hoogtePlaatje) { double verH = (hoogtePlaatje

How to scale and rotate a view in a single animation

泪湿孤枕 提交于 2019-12-10 15:15:51
问题 I am trying to present a view by making it emerge from the centre of the screen while growing to its full size, while also rotating it around the x-axis in a 3D manner. When I create the view I apply a transform to it to make sure it is shrunk and rotated to start off with (it is so small it is not actually visible), then I try to use a CATransform3D like this: CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"]; CATransform3D transform = CATransform3DRotate(view

css3 scale transform / preserve image quality

主宰稳场 提交于 2019-12-10 14:30:03
问题 Let's say a 2000x2000px pixel image is initially displayed at a size that is 10 times lower, meaning 200x200px If transformed through a CSS3 scale(10) here method, it will sure works fine, bu it'll also look very blurry, even if the image is initially displayable at such a size Is there a way to get the initial image size back though this kind of transform ? Meaning displaying the "original" sizes image through a transform 回答1: Put the image in a container, and scale the container. No need

Android: ImageView scales up source image

扶醉桌前 提交于 2019-12-10 13:06:01
问题 I can't seem to get my ImageView to display its source image in its original size. The ImageView looks like this: <ImageView android:id="@+id/Logo" android:src="@drawable/logo" android:layout_width="wrap_content" android:layout_height="wrap_content" > </ImageView> The source image is 140 pixels wide, yet on the Nexus One's screen, which is 480 pixels wide it uses up half of the width. Using absolute values in px or dp for the width and height changes nothing. The image also looks very

[sklearn][standardscaler] can I inverse the standardscaler for the model output?

雨燕双飞 提交于 2019-12-10 12:37:52
问题 I have some data structured as below, trying to predict t from the features. train_df t: time to predict f1: feature1 f2: feature2 f3:...... Can t be scaled with StandardScaler, so I instead predict t' and then inverse the StandardScaler to get back the real time? For example: from sklearn.preprocessing import StandardScaler scaler = StandardScaler() scaler.fit(train_df['t']) train_df['t']= scaler.transform(train_df['t']) run regression model, check score, !! check predicted t' with real time

Coordinates don't change dragging scaled fxg graphics

非 Y 不嫁゛ 提交于 2019-12-10 12:23:51
问题 I'm using FlashDevelop, actionscript 3 and fxg graphics build with Illustrator (exported as fxg 2.0). I import a fxg rectangle build with Illustrator, then I set it draggable when you clik on it, so its coordinates change. This works if the rectangle scale is 1 (this means: no scale). But, if I change its scale (ex. fxgRect.scaleX = fxgRect.scaleY = 0.5; ) you can drag it but its coordinates doesn't change!! And this make me crazy because the sprite changes position but if you ask its

Javascript zoom in/out to mouse x/y coordinates

旧巷老猫 提交于 2019-12-10 12:13:48
问题 I managed to make the mouse dragging to scroll the div, but the zooming in/out with the mouse is not complete. It works, but I would like for the mouse pointer to hold the image in that position and scale it at the same time, like so: I need to use scrollBy() to return the scrolling back to the previous point before scaling. Anyone knows how to do that? This is a fiddle made by someone https://jsfiddle.net/xta2ccdt/13/ and it's exactly what I need, but the code uses translate() and other

PHP resize image proportionally to a bigger size

坚强是说给别人听的谎言 提交于 2019-12-10 11:24:04
问题 I'm currently working on a script that shows thumbnails from a website on a mobile app, and I'm having problems with the "retina display". If the original image is big enough, I show a thumbnail with the double of the required size, and if it is not, I show it on the required size. Now, my function checks if it can be resized proportionally and if it can't, I resize it to the "min-width" or "min-height" and crop it from the center. Here is the problem: if it detects that the image can't be