scale

NVD3.js (d3.js) Scale Break

孤街浪徒 提交于 2019-12-05 05:29:00
问题 I want to create a chart with scale break on y axis. I don't want to use a non-linear scale but using a scale break make lower values more visible when having data anomalies. What is the best way to implement that in nvd3 or in general in d3? 回答1: Lacking other options I created a brute force solution, manipulating the vertical <path> of the Y axis. Using pseudo code, you use it like this: var domainPath = yAxis .select('path.domain'); domainPath.attr('d', breakScale(domainPath.attr('d'), 14,

How to use ImageObserver in Graphics method drawImage()

孤人 提交于 2019-12-05 04:23:15
The method I am trying to use is the: drawImage(image, int, int, int, int, ImageObserver) method so that i can scale my image, on all the examples i've seen the ImageObserver should be this, but this doesn't seem to work(i.e. the only methods i have seen is: drawImage(image, int, int, ImageObserver), don't know if this makes a difference). Here is my main class that is the applet: import java.applet.*; import java.awt.*; public class Main extends Applet implements Runnable{ private Thread th; private Hitter hitter; //double buffering private Graphics dbg; private Image dbImage; public void

How can I scale the background of a button?

馋奶兔 提交于 2019-12-05 03:40:43
I have the following button: <Button android:id="@+id/buttonok" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableLeft="@drawable/back_no_save" android:text="OK" /> Its appearence is: How can I scale down my drawable and show a small arrow? Pathos You could use an ImageButton and try android:scaleType ImageView.ScaleType I don't hink you can from xml. There's no xml attribute that can do scaling for buttons. You can do it programatically though, in the following way : Bitmap originalBitmap= BitmapFactory.decodeResource(getResources(), R.drawable.icon);

difference between methods to scale a bitmap

﹥>﹥吖頭↗ 提交于 2019-12-05 03:23:44
There are at least two methods to scale a bitmap in Android, One is to use "inScaled, inDensity, inTargetDensity" in "BitmapFactory.Options" when decode a bitmap source. The other is to use a "Matrix" in "Bitmap.createBitmap". What I am curious is what the difference between these two method is? What about the quality of produced bitmap? And what about the memory usage? etc... emmby Using BitmapFactory with the proper inScale options will allow you to be more memory efficient than using either Bitmap.createScaledBitmap() or Bitmap.createBitmap() with a matrix scale. However, it is more

HTML5 canvas, scale image after drawing it

烈酒焚心 提交于 2019-12-05 02:55:26
I'm trying to scale an image that has already been draw into canvas. This is the code: var canvas = document.getElementById('splash-container'); var context = canvas.getContext('2d'); var imageObj = new Image(); imageObj.onload = function() { // draw image at its original size context.drawImage(imageObj, 0, 0); }; imageObj.src = 'images/mine.jpeg'; // Now let's scale the image. // something like... imageObj.scale(0.3, 0.3); How should I do? robertc You're thinking about it wrong. Once you've drawn the image onto the canvas it has no relationship to the imageObj object. Nothing you do to

Plot with ggplot a graph with two y scales

非 Y 不嫁゛ 提交于 2019-12-05 02:49:37
问题 So I am trying to compile several dataframe in one graph. For my x value I have the number of days, and for y I have the frequency of something happening. My problem is that one of the dataframe (df3) ranges from 0 to 3, and the others from 0 to 50. Dummy dataframes: day<-c(1,2,3) b<-c(23,44,22) c<-c(12,35,49) d<-c(1,1,3) df1<-data.frame(day,b) df2<-data.frame(day,c) df3<-data.frame(day,d) ggplot()+ geom_line(data=df1, aes(x=day, y=df1$`b`), color="red") + geom_line(data=df2, aes(x=day, y=df2

Getting correct mouse position in a CSS scaled canvas

Deadly 提交于 2019-12-05 02:44:40
问题 I have been trying to take the logic of a couple simple MooTools operations and convert it to work with jQuery. The logic I want is for this jsfiddle what it allows is to get accurate mouse position on a canvas element with css resizing. I found the answer here on SO I have been working for a couple hours with no avail I think I understand his logic but fitting for some reason I am not seeing results Here is what I have done so far with arby's logic from his answer commented out // Get the

Scale website to mobile devices

江枫思渺然 提交于 2019-12-05 02:43:38
I have a web app where responsive layout is not an option for mobile devices, so I tried playing with the viewport scaling a bit but had no success in doing so. Page size is 1280x720 so on small screens it should be zoom out and on larger ones zoomed in: var scale = $(window).width() / 1280; $('head').append('<meta name="viewport" content="width=device-width, height=device-height, initial-scale=' + scale + ', maximum-scale=' + scale + ', user-scalable=0">'); I've only tried this for width but the result is not the desired one, am I doing something wrong? I am not sure exactly what you are

Can Persistence Ignorance Scale?

坚强是说给别人听的谎言 提交于 2019-12-05 02:36:52
I've been having a brief look at NHibernate and Linq2Sql. I'm also intending to have a peek at Entity Framework. The question that gets raised, when I talk of these ORM's is "They can't scale", so can they? From Google I get the impression they're able to scale well, but ultimately I suppose there must be a price to pay, Is it worth paying for a richer simpler business layer. This is a good question, and IMHO they can scale just as well as any custom DAL. I've only used nHibernate so I will focus only on it and the features it has which can help scale a system. Lazy Loading - Since it supports

CSS3 Transform Scale and Container with Overflow

早过忘川 提交于 2019-12-05 01:49:25
问题 I am trying to create a zoom-in functionality for a container with CSS3 Transform (scale) and all seems to work nicely, but when the image is scaled, the overflow only covers a part of the image, leaving the top left part out of the overflow. Code is as follows: HTML: <div class="outer"> <img id="profile" src="http://flickholdr.com/300/200/" /> </div> <button class="zoom orig">Original</button> <button class="zoom x2">x2</button> <button class="zoom x4">x4</button> CSS: .outer { width: 500px;