Built with blockbuilder.org
Last active
May 1, 2017 03:51
-
-
Save maelafifi/cc81161f10302bfd21b321dea2eb169e to your computer and use it in GitHub Desktop.
circlePack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Tree Demo</title> | |
<!-- load D3 //--> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script> | |
<!-- load custom CSS //--> | |
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,900|Source+Code+Pro:300" rel="stylesheet" type="text/css"> | |
<link rel="stylesheet" href="style.css"> | |
<!-- load custom JavaScript //--> | |
<script src="tooltip.js"></script> | |
<svg width="960" height="1000"></svg> | |
</head> | |
<body> | |
<script> | |
// used to color node by depth | |
var color = d3.scaleOrdinal(); | |
// accessor functions for x and y | |
var x = function(d) { return d.x; }; | |
var y = function(d) { return d.y; }; | |
// normal line generator | |
var line = d3.line() | |
.curve(d3.curveLinear) | |
.x(x) | |
.y(y); | |
// configure size, margin, and circle radius | |
var config = { | |
w: 900, | |
h: 475, | |
r: 3, | |
pad: 10 | |
}; | |
// maximum diameter of circle is minimum dimension | |
config.d = Math.min(config.w, config.h); | |
var file = "java.csv"; | |
d3.csv(file, convert, callback); | |
function convert(row) | |
{ | |
var parts = row.id.split(".") | |
row.name = parts[parts.length - 1]; | |
row.value = +row.value; | |
return row; | |
} | |
function callback(error, data) | |
{ | |
if (error) | |
{ | |
console.warn(file, error); | |
return; | |
} | |
console.log("data:", data.length, data); | |
var stratify = d3.stratify() | |
.id(function(d) { return d.id; }) | |
.parentId(function(d) | |
{ | |
return d.id.substring(0, d.id.lastIndexOf(".")); | |
}); | |
var root = stratify(data); | |
root.sort(function(a, b) | |
{ | |
if (a.height != b.height) | |
{ | |
return d3.ascending(a.height, b.height); | |
} | |
else | |
{ | |
return d3.ascending(a.value, b.value); | |
} | |
}); | |
console.log("root:", root); | |
var svg = d3.select("svg"), | |
width = +svg.attr("width"), | |
height = +svg.attr("height"); | |
var g = svg.append("g"); | |
g.attr("id", "plot"); | |
// translate so circle is in middle of plot area | |
var xshift = config.pad + (config.w - config.d) / 2; | |
var yshift = config.pad + (config.h - config.d) / 2; | |
g.attr("transform", translate(xshift, yshift)); | |
// calculate sum for nested circles | |
root.sum(function(d) { return d.value; }); | |
// setup circle packing layout | |
var diameter = config.d - 2 * config.pad; | |
var pack = d3.pack().size([diameter, diameter]).padding(1); | |
// run layout to calculate x, y, and r attributes | |
pack(root); | |
// draw nested circles | |
drawNodes(g, root.descendants(), false); | |
} | |
function drawNodes(g, nodes, raise) | |
{ | |
g.selectAll("circle") | |
.data(nodes) | |
.enter() | |
.append("circle") | |
.attr("r", function(d) { return d.r ? d.r : config.r; }) | |
.attr("cx", x) | |
.attr("cy", y) | |
.attr("id", function(d) { return d.data.name; }) | |
.attr("class", "node") | |
.style("fill", function (d) | |
{ | |
if(d.depth <= 0) | |
{ | |
return "#1b9e77"; | |
} | |
else if(d.depth <= 1) | |
{ | |
return "#d95f02"; | |
} | |
else if(d.depth <= 2) | |
{ | |
return "#7570b3"; | |
} | |
else if(d.depth <= 3) | |
{ | |
return "#e7298a"; | |
} | |
else if(d.depth <= 4) | |
{ | |
return "#66a61e"; | |
} | |
else if(d.depth <= 5) | |
{ | |
return "#e6ab02"; | |
} | |
}) | |
.on("mouseover.tooltip", function(d) | |
{ | |
show_tooltip(g, d3.select(this)); | |
d3.select(this).classed("selected", true); | |
if (raise) | |
{ | |
d3.select(this).raise() | |
.attr("fill", "red"); | |
} | |
}) | |
.on("mouseout.tooltip", function(d) | |
{ | |
g.select("#tooltip").remove(); | |
d3.select(this).classed("selected", false); | |
}); | |
} | |
function drawLinks(g, links, generator) | |
{ | |
var paths = g.selectAll("path") | |
.data(links) | |
.enter() | |
.append("path") | |
.attr("d", generator) | |
.attr("class", "link"); | |
} | |
function toRadians(degrees) | |
{ | |
return degrees * Math.PI / 180; | |
} | |
function toCartesian(r, degrees) | |
{ | |
var theta = toRadians(degrees); | |
var x = r * Math.cos(theta); | |
var y = r * Math.sin(theta); | |
return {"x": x, "y": y}; | |
} | |
function translate(x, y) | |
{ | |
return "translate(" + String(x) + "," + String(y) + ")"; | |
} | |
</script> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | value | |
---|---|---|
java | ||
java.lang | ||
java.lang.AbstractMethodError | 12955.0 | |
java.lang.annotation | ||
java.lang.annotation.Annotation | 27160.0 | |
java.lang.annotation.AnnotationFormatError | 15701.0 | |
java.lang.annotation.AnnotationTypeMismatchException | 16959.0 | |
java.lang.annotation.Documented | 7647.0 | |
java.lang.annotation.ElementType | 23834.0 | |
java.lang.annotation.IncompleteAnnotationException | 17420.0 | |
java.lang.annotation.Inherited | 8292.0 | |
java.lang.annotation.Native | 7450.0 | |
java.lang.annotation.Repeatable | 10011.0 | |
java.lang.annotation.Retention | 9816.0 | |
java.lang.annotation.RetentionPolicy | 17663.0 | |
java.lang.annotation.Target | 11036.0 | |
java.lang.Appendable | 16035.0 | |
java.lang.ArithmeticException | 13164.0 | |
java.lang.ArrayIndexOutOfBoundsException | 14310.0 | |
java.lang.ArrayStoreException | 13045.0 | |
java.lang.AssertionError | 21234.0 | |
java.lang.AutoCloseable | 29920.0 | |
java.lang.Boolean | 38876.0 | |
java.lang.BootstrapMethodError | 15318.0 | |
java.lang.Byte | 53558.0 | |
java.lang.Character | 267392.0 | |
java.lang.Character.Subset | 16320.0 | |
java.lang.Character.UnicodeBlock | 226802.0 | |
java.lang.Character.UnicodeScript | 76239.0 | |
java.lang.CharSequence | 18072.0 | |
java.lang.Class | 165407.0 | |
java.lang.ClassCastException | 12982.0 | |
java.lang.ClassCircularityError | 12878.0 | |
java.lang.ClassFormatError | 13084.0 | |
java.lang.ClassLoader | 94637.0 | |
java.lang.ClassNotFoundException | 19407.0 | |
java.lang.ClassValue | 20386.0 | |
java.lang.Cloneable | 9466.0 | |
java.lang.CloneNotSupportedException | 13472.0 | |
java.lang.Comparable | 31307.0 | |
java.lang.Compiler | 15731.0 | |
java.lang.Deprecated | 7860.0 | |
java.lang.Double | 80718.0 | |
java.lang.Enum | 28830.0 | |
java.lang.EnumConstantNotPresentException | 16334.0 | |
java.lang.Error | 20537.0 | |
java.lang.Exception | 28237.0 | |
java.lang.ExceptionInInitializerError | 19408.0 | |
java.lang.Float | 78795.0 | |
java.lang.FunctionalInterface | 8686.0 | |
java.lang.IllegalAccessError | 13183.0 | |
java.lang.IllegalAccessException | 15678.0 | |
java.lang.IllegalArgumentException | 18774.0 | |
java.lang.IllegalMonitorStateException | 13633.0 | |
java.lang.IllegalStateException | 19874.0 | |
java.lang.IllegalThreadStateException | 13562.0 | |
java.lang.IncompatibleClassChangeError | 13752.0 | |
java.lang.IndexOutOfBoundsException | 13443.0 | |
java.lang.InheritableThreadLocal | 14217.0 | |
java.lang.InstantiationError | 13191.0 | |
java.lang.InstantiationException | 13407.0 | |
java.lang.instrument | ||
java.lang.instrument.ClassDefinition | 13779.0 | |
java.lang.instrument.ClassFileTransformer | 18673.0 | |
java.lang.instrument.IllegalClassFormatException | 13884.0 | |
java.lang.instrument.Instrumentation | 59419.0 | |
java.lang.instrument.UnmodifiableClassException | 13280.0 | |
java.lang.Integer | 106646.0 | |
java.lang.InternalError | 16128.0 | |
java.lang.InterruptedException | 13550.0 | |
java.lang.invoke | ||
java.lang.invoke.CallSite | 19726.0 | |
java.lang.invoke.ConstantCallSite | 23016.0 | |
java.lang.invoke.LambdaConversionException | 16923.0 | |
java.lang.invoke.LambdaMetafactory | 44500.0 | |
java.lang.invoke.MethodHandle | 89456.0 | |
java.lang.invoke.MethodHandleInfo | 40189.0 | |
java.lang.invoke.MethodHandleProxies | 21683.0 | |
java.lang.invoke.MethodHandles | 95490.0 | |
java.lang.invoke.MethodHandles.Lookup | 104097.0 | |
java.lang.invoke.MethodType | 67345.0 | |
java.lang.invoke.MutableCallSite | 30349.0 | |
java.lang.invoke.SerializedLambda | 30110.0 | |
java.lang.invoke.SwitchPoint | 23173.0 | |
java.lang.invoke.VolatileCallSite | 20452.0 | |
java.lang.invoke.WrongMethodTypeException | 13456.0 | |
java.lang.Iterable | 21805.0 | |
java.lang.LinkageError | 14649.0 | |
java.lang.Long | 106101.0 | |
java.lang.management | ||
java.lang.management.BufferPoolMXBean | 14268.0 | |
java.lang.management.ClassLoadingMXBean | 15680.0 | |
java.lang.management.CompilationMXBean | 14449.0 | |
java.lang.management.GarbageCollectorMXBean | 14203.0 | |
java.lang.management.LockInfo | 19438.0 | |
java.lang.management.ManagementFactory | 71888.0 | |
java.lang.management.ManagementPermission | 16923.0 | |
java.lang.management.MemoryManagerMXBean | 13832.0 | |
java.lang.management.MemoryMXBean | 25901.0 | |
java.lang.management.MemoryNotificationInfo | 26074.0 | |
java.lang.management.MemoryPoolMXBean | 51613.0 | |
java.lang.management.MemoryType | 17899.0 | |
java.lang.management.MemoryUsage | 22588.0 | |
java.lang.management.MonitorInfo | 18806.0 | |
java.lang.management.OperatingSystemMXBean | 18247.0 | |
java.lang.management.PlatformLoggingMXBean | 19082.0 | |
java.lang.management.PlatformManagedObject | 12324.0 | |
java.lang.management.RuntimeMXBean | 36124.0 | |
java.lang.management.ThreadInfo | 44282.0 | |
java.lang.management.ThreadMXBean | 69096.0 | |
java.lang.Math | 129239.0 | |
java.lang.NegativeArraySizeException | 12992.0 | |
java.lang.NoClassDefFoundError | 13171.0 | |
java.lang.NoSuchFieldError | 13116.0 | |
java.lang.NoSuchFieldException | 12658.0 | |
java.lang.NoSuchMethodError | 13180.0 | |
java.lang.NoSuchMethodException | 12871.0 | |
java.lang.NullPointerException | 13638.0 | |
java.lang.Number | 19312.0 | |
java.lang.NumberFormatException | 13208.0 | |
java.lang.Object | 43427.0 | |
java.lang.OutOfMemoryError | 13047.0 | |
java.lang.Override | 7545.0 | |
java.lang.Package | 47629.0 | |
java.lang.Process | 27129.0 | |
java.lang.ProcessBuilder | 59912.0 | |
java.lang.ProcessBuilder.Redirect | 25411.0 | |
java.lang.ProcessBuilder.Redirect.Type | 18941.0 | |
java.lang.Readable | 11211.0 | |
java.lang.ref | ||
java.lang.ref.PhantomReference | 15242.0 | |
java.lang.ref.Reference | 13982.0 | |
java.lang.ref.ReferenceQueue | 16365.0 | |
java.lang.ref.SoftReference | 17002.0 | |
java.lang.ref.WeakReference | 13376.0 | |
java.lang.reflect | ||
java.lang.reflect.AccessibleObject | 37949.0 | |
java.lang.reflect.AnnotatedArrayType | 11652.0 | |
java.lang.reflect.AnnotatedElement | 37939.0 | |
java.lang.reflect.AnnotatedParameterizedType | 11792.0 | |
java.lang.reflect.AnnotatedType | 11550.0 | |
java.lang.reflect.AnnotatedTypeVariable | 11604.0 | |
java.lang.reflect.AnnotatedWildcardType | 12703.0 | |
java.lang.reflect.Array | 63168.0 | |
java.lang.reflect.Constructor | 60911.0 | |
java.lang.reflect.Executable | 51131.0 | |
java.lang.reflect.Field | 93956.0 | |
java.lang.reflect.GenericArrayType | 11198.0 | |
java.lang.reflect.GenericDeclaration | 12223.0 | |
java.lang.reflect.GenericSignatureFormatError | 13612.0 | |
java.lang.reflect.InvocationHandler | 14082.0 | |
java.lang.reflect.InvocationTargetException | 19132.0 | |
java.lang.reflect.MalformedParameterizedTypeException | 12480.0 | |
java.lang.reflect.MalformedParametersException | 14196.0 | |
java.lang.reflect.Member | 15803.0 | |
java.lang.reflect.Method | 66573.0 | |
java.lang.reflect.Modifier | 44036.0 | |
java.lang.reflect.Parameter | 40151.0 | |
java.lang.reflect.ParameterizedType | 14646.0 | |
java.lang.reflect.Proxy | 38777.0 | |
java.lang.reflect.ReflectPermission | 16752.0 | |
java.lang.reflect.Type | 10178.0 | |
java.lang.reflect.TypeVariable | 17392.0 | |
java.lang.reflect.UndeclaredThrowableException | 19765.0 | |
java.lang.reflect.WildcardType | 12955.0 | |
java.lang.ReflectiveOperationException | 17618.0 | |
java.lang.Runnable | 12018.0 | |
java.lang.Runtime | 73484.0 | |
java.lang.RuntimeException | 25725.0 | |
java.lang.RuntimePermission | 26639.0 | |
java.lang.SafeVarargs | 9537.0 | |
java.lang.SecurityException | 16310.0 | |
java.lang.SecurityManager | 121830.0 | |
java.lang.Short | 55174.0 | |
java.lang.StackOverflowError | 12761.0 | |
java.lang.StackTraceElement | 25424.0 | |
java.lang.StrictMath | 117565.0 | |
java.lang.String | 179522.0 | |
java.lang.StringBuffer | 110068.0 | |
java.lang.StringBuilder | 108328.0 | |
java.lang.StringIndexOutOfBoundsException | 14588.0 | |
java.lang.SuppressWarnings | 11021.0 | |
java.lang.System | 81954.0 | |
java.lang.Thread | 115753.0 | |
java.lang.Thread.State | 21327.0 | |
java.lang.Thread.UncaughtExceptionHandler | 11894.0 | |
java.lang.ThreadDeath | 12242.0 | |
java.lang.ThreadGroup | 55196.0 | |
java.lang.ThreadLocal | 20118.0 | |
java.lang.Throwable | 54600.0 | |
java.lang.TypeNotPresentException | 15577.0 | |
java.lang.UnknownError | 12634.0 | |
java.lang.UnsatisfiedLinkError | 12977.0 | |
java.lang.UnsupportedClassVersionError | 13326.0 | |
java.lang.UnsupportedOperationException | 17316.0 | |
java.lang.VerifyError | 12638.0 | |
java.lang.VirtualMachineError | 16532.0 | |
java.lang.Void | 9876.0 | |
java.util | ||
java.util.AbstractCollection | 52188.0 | |
java.util.AbstractList | 66894.0 | |
java.util.AbstractMap | 59953.0 | |
java.util.AbstractMap.SimpleEntry | 25438.0 | |
java.util.AbstractMap.SimpleImmutableEntry | 26474.0 | |
java.util.AbstractQueue | 30390.0 | |
java.util.AbstractSequentialList | 41451.0 | |
java.util.AbstractSet | 26464.0 | |
java.util.ArrayDeque | 83517.0 | |
java.util.ArrayList | 94620.0 | |
java.util.Arrays | 339951.0 | |
java.util.Base64.Decoder | 19745.0 | |
java.util.Base64.Encoder | 19708.0 | |
java.util.Base64 | 21641.0 | |
java.util.BitSet | 59656.0 | |
java.util.Calendar.Builder | 45355.0 | |
java.util.Calendar | 179084.0 | |
java.util.Collection | 63056.0 | |
java.util.Collections | 178171.0 | |
java.util.Comparator | 59227.0 | |
java.util.concurrent | ||
java.util.concurrent.AbstractExecutorService | 41895.0 | |
java.util.concurrent.ArrayBlockingQueue | 71548.0 | |
java.util.concurrent.atomic | ||
java.util.concurrent.atomic.AtomicBoolean | 19384.0 | |
java.util.concurrent.atomic.AtomicInteger | 36886.0 | |
java.util.concurrent.atomic.AtomicIntegerArray | 34818.0 | |
java.util.concurrent.atomic.AtomicIntegerFieldUpdater | 42839.0 | |
java.util.concurrent.atomic.AtomicLong | 36826.0 | |
java.util.concurrent.atomic.AtomicLongArray | 34754.0 | |
java.util.concurrent.atomic.AtomicLongFieldUpdater | 42658.0 | |
java.util.concurrent.atomic.AtomicMarkableReference | 23635.0 | |
java.util.concurrent.atomic.AtomicReference | 31478.0 | |
java.util.concurrent.atomic.AtomicReferenceArray | 35043.0 | |
java.util.concurrent.atomic.AtomicReferenceFieldUpdater | 40864.0 | |
java.util.concurrent.atomic.AtomicStampedReference | 23484.0 | |
java.util.concurrent.atomic.DoubleAccumulator | 25228.0 | |
java.util.concurrent.atomic.DoubleAdder | 23674.0 | |
java.util.concurrent.atomic.LongAccumulator | 25356.0 | |
java.util.concurrent.atomic.LongAdder | 24771.0 | |
java.util.concurrent.BlockingDeque | 95136.0 | |
java.util.concurrent.BlockingQueue | 44846.0 | |
java.util.concurrent.BrokenBarrierException | 13294.0 | |
java.util.concurrent.Callable | 11102.0 | |
java.util.concurrent.CancellationException | 13566.0 | |
java.util.concurrent.CompletableFuture.AsynchronousCompletionTask | 7644.0 | |
java.util.concurrent.CompletableFuture | 186898.0 | |
java.util.concurrent.CompletionException | 16557.0 | |
java.util.concurrent.CompletionService | 20087.0 | |
java.util.concurrent.CompletionStage | 115514.0 | |
java.util.concurrent.ConcurrentHashMap | 207497.0 | |
java.util.concurrent.ConcurrentHashMap.KeySetView | 58242.0 | |
java.util.concurrent.ConcurrentLinkedDeque | 91451.0 | |
java.util.concurrent.ConcurrentLinkedQueue | 50617.0 | |
java.util.concurrent.ConcurrentMap | 61075.0 | |
java.util.concurrent.ConcurrentNavigableMap | 55603.0 | |
java.util.concurrent.ConcurrentSkipListMap | 187419.0 | |
java.util.concurrent.ConcurrentSkipListSet | 103952.0 | |
java.util.concurrent.CopyOnWriteArrayList | 98649.0 | |
java.util.concurrent.CopyOnWriteArraySet | 64887.0 | |
java.util.concurrent.CountDownLatch | 24747.0 | |
java.util.concurrent.CountedCompleter | 65441.0 | |
java.util.concurrent.CyclicBarrier | 30973.0 | |
java.util.concurrent.Delayed | 10850.0 | |
java.util.concurrent.DelayQueue | 61308.0 | |
java.util.concurrent.Exchanger | 20688.0 | |
java.util.concurrent.ExecutionException | 16505.0 | |
java.util.concurrent.Executor | 13814.0 | |
java.util.concurrent.ExecutorCompletionService | 30763.0 | |
java.util.concurrent.Executors | 59284.0 | |
java.util.concurrent.ExecutorService | 43148.0 | |
java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory | 10730.0 | |
java.util.concurrent.ForkJoinPool | 87843.0 | |
java.util.concurrent.ForkJoinPool.ManagedBlocker | 12962.0 | |
java.util.concurrent.ForkJoinTask | 82817.0 | |
java.util.concurrent.ForkJoinWorkerThread | 23995.0 | |
java.util.concurrent.Future | 20372.0 | |
java.util.concurrent.FutureTask | 33548.0 | |
java.util.concurrent.LinkedBlockingDeque | 147048.0 | |
java.util.concurrent.LinkedBlockingQueue | 66916.0 | |
java.util.concurrent.LinkedTransferQueue | 72791.0 | |
java.util.concurrent.locks | ||
java.util.concurrent.locks.AbstractOwnableSynchronizer | 14835.0 | |
java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject | 34389.0 | |
java.util.concurrent.locks.AbstractQueuedLongSynchronizer | 69366.0 | |
java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject | 33954.0 | |
java.util.concurrent.locks.AbstractQueuedSynchronizer | 81713.0 | |
java.util.concurrent.locks.Condition | 36232.0 | |
java.util.concurrent.locks.Lock | 28286.0 | |
java.util.concurrent.locks.LockSupport | 28401.0 | |
java.util.concurrent.locks.ReadWriteLock | 15356.0 | |
java.util.concurrent.locks.ReentrantLock | 52223.0 | |
java.util.concurrent.locks.ReentrantReadWriteLock | 49572.0 | |
java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock | 27538.0 | |
java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock | 34031.0 | |
java.util.concurrent.locks.StampedLock | 50130.0 | |
java.util.concurrent.Phaser | 51658.0 | |
java.util.concurrent.PriorityBlockingQueue | 75435.0 | |
java.util.concurrent.RecursiveAction | 24199.0 | |
java.util.concurrent.RecursiveTask | 22409.0 | |
java.util.concurrent.RejectedExecutionException | 16669.0 | |
java.util.concurrent.RejectedExecutionHandler | 12057.0 | |
java.util.concurrent.RunnableFuture | 11922.0 | |
java.util.concurrent.RunnableScheduledFuture | 13227.0 | |
java.util.concurrent.ScheduledExecutorService | 26091.0 | |
java.util.concurrent.ScheduledFuture | 9993.0 | |
java.util.concurrent.ScheduledThreadPoolExecutor | 80790.0 | |
java.util.concurrent.Semaphore | 50058.0 | |
java.util.concurrent.SynchronousQueue | 64996.0 | |
java.util.concurrent.ThreadFactory | 10421.0 | |
java.util.concurrent.ThreadLocalRandom | 57972.0 | |
java.util.concurrent.ThreadPoolExecutor.AbortPolicy | 13841.0 | |
java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy | 14028.0 | |
java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy | 14338.0 | |
java.util.concurrent.ThreadPoolExecutor.DiscardPolicy | 13680.0 | |
java.util.concurrent.ThreadPoolExecutor | 94555.0 | |
java.util.concurrent.TimeoutException | 13209.0 | |
java.util.concurrent.TimeUnit | 36068.0 | |
java.util.concurrent.TransferQueue | 26002.0 | |
java.util.ConcurrentModificationException | 19445.0 | |
java.util.Currency | 27541.0 | |
java.util.Date | 80293.0 | |
java.util.Deque | 65663.0 | |
java.util.Dictionary | 22891.0 | |
java.util.DoubleSummaryStatistics | 23820.0 | |
java.util.DuplicateFormatFlagsException | 16291.0 | |
java.util.EmptyStackException | 12083.0 | |
java.util.Enumeration | 12202.0 | |
java.util.EnumMap | 57149.0 | |
java.util.EnumSet | 44189.0 | |
java.util.EventListener | 52700.0 | |
java.util.EventListenerProxy | 13962.0 | |
java.util.EventObject | 18974.0 | |
java.util.FormatFlagsConversionMismatchException | 17232.0 | |
java.util.Formattable | 15415.0 | |
java.util.FormattableFlags | 13139.0 | |
java.util.Formatter.BigDecimalLayoutForm | 16391.0 | |
java.util.Formatter | 142344.0 | |
java.util.FormatterClosedException | 12380.0 | |
java.util.function | ||
java.util.function.BiConsumer | 13515.0 | |
java.util.function.BiFunction | 14066.0 | |
java.util.function.BinaryOperator | 14836.0 | |
java.util.function.BiPredicate | 18289.0 | |
java.util.function.BooleanSupplier | 9978.0 | |
java.util.function.Consumer | 12759.0 | |
java.util.function.DoubleBinaryOperator | 10554.0 | |
java.util.function.DoubleConsumer | 12732.0 | |
java.util.function.DoubleFunction | 10423.0 | |
java.util.function.DoublePredicate | 15634.0 | |
java.util.function.DoubleSupplier | 9975.0 | |
java.util.function.DoubleToIntFunction | 10211.0 | |
java.util.function.DoubleToLongFunction | 10244.0 | |
java.util.function.DoubleUnaryOperator | 16028.0 | |
java.util.function.Function | 17277.0 | |
java.util.function.IntBinaryOperator | 10417.0 | |
java.util.function.IntConsumer | 12707.0 | |
java.util.function.IntFunction | 10334.0 | |
java.util.function.IntPredicate | 15475.0 | |
java.util.function.IntSupplier | 9891.0 | |
java.util.function.IntToDoubleFunction | 10211.0 | |
java.util.function.IntToLongFunction | 10173.0 | |
java.util.function.IntUnaryOperator | 15845.0 | |
java.util.function.LongBinaryOperator | 10478.0 | |
java.util.function.LongConsumer | 12642.0 | |
java.util.function.LongFunction | 10363.0 | |
java.util.function.LongPredicate | 15528.0 | |
java.util.function.LongSupplier | 9921.0 | |
java.util.function.LongToDoubleFunction | 10234.0 | |
java.util.function.LongToIntFunction | 10173.0 | |
java.util.function.LongUnaryOperator | 15908.0 | |
java.util.function.ObjDoubleConsumer | 10748.0 | |
java.util.function.ObjIntConsumer | 10666.0 | |
java.util.function.ObjLongConsumer | 10676.0 | |
java.util.function.Predicate | 18491.0 | |
java.util.function.Supplier | 9757.0 | |
java.util.function.ToDoubleBiFunction | 11047.0 | |
java.util.function.ToDoubleFunction | 10549.0 | |
java.util.function.ToIntBiFunction | 10944.0 | |
java.util.function.ToIntFunction | 10453.0 | |
java.util.function.ToLongBiFunction | 10977.0 | |
java.util.function.ToLongFunction | 10479.0 | |
java.util.function.UnaryOperator | 11653.0 | |
java.util.GregorianCalendar | 98055.0 | |
java.util.HashMap | 84326.0 | |
java.util.HashSet | 41542.0 | |
java.util.Hashtable | 92112.0 | |
java.util.IdentityHashMap | 68286.0 | |
java.util.IllegalFormatCodePointException | 16764.0 | |
java.util.IllegalFormatConversionException | 17418.0 | |
java.util.IllegalFormatException | 12312.0 | |
java.util.IllegalFormatFlagsException | 16270.0 | |
java.util.IllegalFormatPrecisionException | 15801.0 | |
java.util.IllegalFormatWidthException | 15613.0 | |
java.util.IllformedLocaleException | 16599.0 | |
java.util.InputMismatchException | 13504.0 | |
java.util.IntSummaryStatistics | 21709.0 | |
java.util.InvalidPropertiesFormatException | 14217.0 | |
java.util.Iterator | 16382.0 | |
java.util.jar | ||
java.util.jar.Attributes | 47001.0 | |
java.util.jar.Attributes.Name | 37189.0 | |
java.util.jar.JarEntry | 43386.0 | |
java.util.jar.JarException | 12895.0 | |
java.util.jar.JarFile | 54959.0 | |
java.util.jar.JarInputStream | 49967.0 | |
java.util.jar.JarOutputStream | 43096.0 | |
java.util.jar.Manifest | 25516.0 | |
java.util.jar.Pack200 | 17350.0 | |
java.util.jar.Pack200.Packer | 55414.0 | |
java.util.jar.Pack200.Unpacker | 26924.0 | |
java.util.LinkedHashMap | 57801.0 | |
java.util.LinkedHashSet | 28898.0 | |
java.util.LinkedList | 102288.0 | |
java.util.List | 80539.0 | |
java.util.ListIterator | 26035.0 | |
java.util.ListResourceBundle | 24534.0 | |
java.util.Locale.Builder | 36396.0 | |
java.util.Locale.Category | 16402.0 | |
java.util.Locale.FilteringMode | 22827.0 | |
java.util.Locale | 141852.0 | |
java.util.Locale.LanguageRange | 35788.0 | |
java.util.logging | ||
java.util.logging.ConsoleHandler | 17234.0 | |
java.util.logging.ErrorManager | 18283.0 | |
java.util.logging.FileHandler | 31099.0 | |
java.util.logging.Filter | 9916.0 | |
java.util.logging.Formatter | 17788.0 | |
java.util.logging.Handler | 31676.0 | |
java.util.logging.Level | 34289.0 | |
java.util.logging.Logger | 139748.0 | |
java.util.logging.LoggingMXBean | 17828.0 | |
java.util.logging.LoggingPermission | 14170.0 | |
java.util.logging.LogManager | 40191.0 | |
java.util.logging.LogRecord | 36984.0 | |
java.util.logging.MemoryHandler | 25814.0 | |
java.util.logging.SimpleFormatter | 18117.0 | |
java.util.logging.SocketHandler | 20164.0 | |
java.util.logging.StreamHandler | 25525.0 | |
java.util.logging.XMLFormatter | 16283.0 | |
java.util.LongSummaryStatistics | 23417.0 | |
java.util.Map.Entry | 28152.0 | |
java.util.Map | 88628.0 | |
java.util.MissingFormatArgumentException | 16471.0 | |
java.util.MissingFormatWidthException | 16362.0 | |
java.util.MissingResourceException | 15939.0 | |
java.util.NavigableMap | 66392.0 | |
java.util.NavigableSet | 50697.0 | |
java.util.NoSuchElementException | 13451.0 | |
java.util.Objects | 33357.0 | |
java.util.Observable | 22820.0 | |
java.util.Observer | 9730.0 | |
java.util.Optional | 36520.0 | |
java.util.OptionalDouble | 26375.0 | |
java.util.OptionalInt | 26096.0 | |
java.util.OptionalLong | 26200.0 | |
java.util.prefs | ||
java.util.prefs.AbstractPreferences | 143610.0 | |
java.util.prefs.BackingStoreException | 13327.0 | |
java.util.prefs.InvalidPreferencesFormatException | 15983.0 | |
java.util.prefs.NodeChangeEvent | 15678.0 | |
java.util.prefs.NodeChangeListener | 11219.0 | |
java.util.prefs.PreferenceChangeEvent | 17010.0 | |
java.util.prefs.PreferenceChangeListener | 10673.0 | |
java.util.prefs.Preferences | 122283.0 | |
java.util.prefs.PreferencesFactory | 10804.0 | |
java.util.PrimitiveIterator | 15825.0 | |
java.util.PrimitiveIterator.OfDouble | 18397.0 | |
java.util.PrimitiveIterator.OfInt | 18274.0 | |
java.util.PrimitiveIterator.OfLong | 18232.0 | |
java.util.PriorityQueue | 55320.0 | |
java.util.Properties | 61933.0 | |
java.util.PropertyPermission | 22850.0 | |
java.util.PropertyResourceBundle | 26112.0 | |
java.util.Queue | 27743.0 | |
java.util.Random | 59813.0 | |
java.util.RandomAccess | 8960.0 | |
java.util.regex | ||
java.util.regex.Matcher | 73507.0 | |
java.util.regex.MatchResult | 19249.0 | |
java.util.regex.Pattern | 82761.0 | |
java.util.regex.PatternSyntaxException | 17821.0 | |
java.util.ResourceBundle.Control | 69490.0 | |
java.util.ResourceBundle | 80769.0 | |
java.util.Scanner | 128262.0 | |
java.util.ServiceConfigurationError | 14124.0 | |
java.util.ServiceLoader | 29473.0 | |
java.util.Set | 50926.0 | |
java.util.SimpleTimeZone | 72679.0 | |
java.util.SortedMap | 38030.0 | |
java.util.SortedSet | 33271.0 | |
java.util.spi | ||
java.util.spi.CalendarDataProvider | 15961.0 | |
java.util.spi.CalendarNameProvider | 30928.0 | |
java.util.spi.CurrencyNameProvider | 17828.0 | |
java.util.spi.LocaleNameProvider | 25088.0 | |
java.util.spi.LocaleServiceProvider | 23489.0 | |
java.util.spi.ResourceBundleControlProvider | 11894.0 | |
java.util.spi.TimeZoneNameProvider | 19268.0 | |
java.util.Spliterator | 59056.0 | |
java.util.Spliterator.OfDouble | 27124.0 | |
java.util.Spliterator.OfInt | 26941.0 | |
java.util.Spliterator.OfLong | 26943.0 | |
java.util.Spliterator.OfPrimitive | 21713.0 | |
java.util.Spliterators.AbstractDoubleSpliterator | 27533.0 | |
java.util.Spliterators.AbstractIntSpliterator | 27404.0 | |
java.util.Spliterators.AbstractLongSpliterator | 27419.0 | |
java.util.Spliterators.AbstractSpliterator | 25377.0 | |
java.util.Spliterators | 74709.0 | |
java.util.SplittableRandom | 48098.0 | |
java.util.Stack | 23609.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-weight: 300; | |
color: red; | |
text-align: center; | |
background-color: #eeeeee; | |
} | |
svg { | |
background-color: silver; | |
} | |
b { | |
font-weight: 900; | |
} | |
.node { | |
stroke: silver; | |
stroke-width: .5px; | |
color: red; | |
} | |
.link { | |
fill: none; | |
stroke: silver; | |
stroke-width: 1px; | |
} | |
.selected { | |
stroke: red !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TOOLTIP HANDLING | |
* Since this is not the focus of this example, I moved the | |
* tooltip code to a separate file. | |
* | |
* This function creates svg text as a tooltip for a specified | |
* node. The node must have the tooltip text as the id. Works | |
* with both circles and rects. | |
* | |
* This is pretty ugly code. I'm sorry. | |
*/ | |
function show_tooltip(g, node) { | |
// get bounding box of group BEFORE adding text | |
var gbox = g.node().getBBox(); | |
// get bounding box of node | |
var nbox = node.node().getBBox(); | |
// calculate shift amount | |
var shift_x = nbox.width / 2; | |
var shift_y = nbox.height / 2; | |
// retrieve node attributes (calculate middle point) | |
var x = nbox.x + shift_x; | |
var y = nbox.y + shift_y; | |
var text = node.attr("id"); | |
// create tooltip | |
var tooltip = g.append("text") | |
.text(text) | |
.attr("x", x) | |
.attr("y", y) | |
.attr("dy", -shift_y - 4) // shift upward above circle | |
.attr("text-anchor", "middle") // anchor in the middle | |
.attr("id", "tooltip"); | |
// set tooltip style | |
tooltip.style("font-size", "12pt") | |
.style("font-weight", "900") | |
.style("fill", "#ffff99") | |
.style("stroke", "#ffff99") | |
.style("stroke-width", "0.35px"); | |
// it is possible the tooltip will fall off the edge of the | |
// plot area. we can detect when this happens, and set the | |
// text anchor appropriately | |
// get bounding box for the text | |
var tbox = tooltip.node().getBBox(); | |
// if text will fall off left side, anchor at start | |
if (tbox.x < gbox.x) { | |
tooltip.attr("text-anchor", "start"); | |
tooltip.attr("dx", -shift_x); // nudge text over from center | |
} | |
// if text will fall off right side, anchor at end | |
else if ((tbox.x + tbox.width) > (gbox.x + gbox.width)) { | |
tooltip.attr("text-anchor", "end"); | |
tooltip.attr("dx", shift_x); | |
} | |
// if text will fall off top side, place below circle instead | |
if (tbox.y < gbox.y) { | |
tooltip.attr("dy", shift_y + tbox.height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment