Skip to content

Commit

Permalink
Auto-commiting vulcanized standalone embedding projector.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Thorat committed Dec 8, 2016
1 parent 1551794 commit e24d926
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Binary file added favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions index.html
Expand Up @@ -39,6 +39,22 @@
limitations under the License.
-->
<meta charset="UTF-8">
<meta name="keywords" content="visualization,embeddings,machine learning,javascript">

<meta property="og:type" content="article">
<meta property="og:title" content="Embedding projector - visualization of high-dimensional data">
<meta property="og:description" content="Visualize high dimensional data.">
<meta property="og:url" content="http://projector.tensorflow.org">
<meta property="og:image" content="preview.png">

<meta name="twitter:card" value="summary_large_image">
<meta name="twitter:title" content="Embedding projector - visualization of high-dimensional data">
<meta name="twitter:description" content="Visualize high dimensional data.">
<meta name="twitter:url" content="http://projector.tensorflow.org">
<meta name="twitter:image" content="preview.png">

<meta name="author" content="Daniel Smilkov, Nikhil Thorat, Charles Nicholson, Big Picture">

<link rel="icon" type="image/png" href="favicon.png">

<title>Embedding projector - visualization of high-dimensional data</title>
Expand Down Expand Up @@ -5884,7 +5900,7 @@ <h3>2D controls</h3>
N.exportPath_=function(a,b,c){a=a.split(".");c=c||N.global;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&N.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};N.define=function(a,b){N.exportPath_(a,b)};N.DEBUG=!0;N.LOCALE="en";N.TRUSTED_SITE=!0;N.STRICT_MODE_COMPATIBLE=!1;N.DISALLOW_TEST_ONLY_CODE=!N.DEBUG;N.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;N.provide=function(a){if(N.isInModuleLoader_())throw Error("goog.provide can not be used within a goog.module.");N.constructNamespace_(a)};
N.constructNamespace_=function(a,b){N.exportPath_(a,b)};N.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
N.module=function(a){if(!N.isString(a)||!a||-1==a.search(N.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!N.isInModuleLoader_())throw Error("Module "+a+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(N.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");
N.moduleLoaderState_.moduleName=a};N.module.get=function(a){return N.module.getInternal_(a)};N.module.getInternal_=function(a){};N.moduleLoaderState_=null;N.isInModuleLoader_=function(){return null!=N.moduleLoaderState_};N.module.declareLegacyNamespace=function(){N.moduleLoaderState_.declareLegacyNamespace=!0};N.setTestOnly=function(a){if(N.DISALLOW_TEST_ONLY_CODE)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};N.forwardDeclare=function(a){};
N.moduleLoaderState_.moduleName=a};N.module.get=function(a){return N.module.getInternal_(a)};N.module.getInternal_=function(a){return null};N.moduleLoaderState_=null;N.isInModuleLoader_=function(){return null!=N.moduleLoaderState_};N.module.declareLegacyNamespace=function(){N.moduleLoaderState_.declareLegacyNamespace=!0};N.setTestOnly=function(a){if(N.DISALLOW_TEST_ONLY_CODE)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};N.forwardDeclare=function(a){};
N.getObjectByName=function(a,b){a=a.split(".");b=b||N.global;for(var c;c=a.shift();)if(N.isDefAndNotNull(b[c]))b=b[c];else return null;return b};N.globalize=function(a,b){b=b||N.global;for(var c in a)b[c]=a[c]};
N.addDependency=function(a,b,c,d){if(N.DEPENDENCIES_ENABLED){var e;a=a.replace(/\\/g,"/");var f=N.dependencies_;d&&"boolean"!==typeof d||(d=d?{module:"goog"}:{});for(var g=0;e=b[g];g++)f.nameToPath[e]=a,f.loadFlags[a]=d;for(d=0;b=c[d];d++)a in f.requires||(f.requires[a]={}),f.requires[a][b]=!0}};N.useStrictRequires=!1;N.ENABLE_DEBUG_LOADER=!0;N.logToConsole_=function(a){N.global.console&&N.global.console.error(a)};N.require=function(a){};N.basePath="";N.nullFunction=function(){};
N.abstractMethod=function(){throw Error("unimplemented abstract method");};N.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;N.DEBUG&&(N.instantiatedSingletons_[N.instantiatedSingletons_.length]=a);return a.instance_=new a}};N.instantiatedSingletons_=[];N.LOAD_MODULE_USING_EVAL=!0;N.SEAL_MODULE_EXPORTS=N.DEBUG;N.loadedModules_={};N.DEPENDENCIES_ENABLED=!1;N.TRANSPILE="detect";N.TRANSPILER="transpile.js";
Expand Down Expand Up @@ -8233,7 +8249,7 @@ <h3>2D controls</h3>
function To(a,b){var c=a.map(function(a){return{name:a,isNumeric:!0,tooManyUniqueValues:!1,min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY}}),d=a.map(function(){return d3.map()});b.forEach(function(b){a.forEach(function(a,e){var f=c[e];e=d[e];var g=b[a];null!=g&&(f.tooManyUniqueValues||(e.has(g)?e.set(g,e.get(g)+1):e.set(g,1),50<e.size()&&(f.tooManyUniqueValues=!0)),isNaN(g)?f.isNumeric=!1:(b[a]=+g,f.min=Math.min(f.min,+g),f.max=Math.max(f.max,+g)))})});c.forEach(function(a,b){b=d[b];a.tooManyUniqueValues||
(a.uniqueEntries=b.entries().map(function(a){return{label:a.key,count:a.value}}))});return c}Lo.analyzeMetadata=To;
function So(a){return In("Parsing metadata...",function(){var b=a.split("\n").filter(function(a){return 0<a.trim().length}),c=0<=b[0].indexOf("\t"),d=[],e=["label"];c&&(e=b[0].split("\t"),b=b.slice(1));b.forEach(function(a){var b=a.split("\t"),c={};d.push(c);e.forEach(function(a,d){d=b[d];d=""===d?null:d;c[a]=d})});return{stats:To(e,d),pointsInfo:d}},Lo.METADATA_MSG_ID).then(function(a){wn(null,Lo.METADATA_MSG_ID);return a})}Lo.parseMetadata=So;
function Uo(a){return new Promise(function(b,c){var d=new Image;d.onload=function(){return b(d)};d.onerror=function(a){return c(a)};d.src=a})}Lo.fetchImage=Uo;
function Uo(a){return new Promise(function(b,c){var d=new Image;d.onload=function(){return b(d)};d.onerror=function(a){return c(a)};d.crossOrigin="";d.src=a})}Lo.fetchImage=Uo;
function Vo(a,b,c,d){var e=Promise.resolve({});a&&(e=new Promise(function(b,c){wn("Fetching metadata...",Lo.METADATA_MSG_ID);d3.text(a,function(a,d){a?(xn(a.responseText),c(a)):b(So(d))})}));var f=null,g=null;b&&(f=wn("Fetching sprite image..."),g=Uo(b));Promise.all([e,g]).then(function(a){f&&wn(null,f);var b=F.makeIterator(a);a=b.next().value;(b=b.next().value)&&(8192<b.height||8192<b.width)?wn("Error: Sprite image of dimensions "+b.width+"px x "+(b.height+"px exceeds maximum dimensions ")+"8192px x 8192px"):
(a.spriteImage=b,a.spriteMetadata=c,d(a))})}Lo.retrieveSpriteAndMetadataInfo=Vo;var Wo={},Xo={id:"third_party/tensorflow/tensorboard/components/vz_projector/data-provider-demo"},Yo=Lo,Zo=function(a){this.projectorConfigPath=a};q=Zo.prototype;q.getEmbeddingInfo=function(a){for(var b=this.projectorConfig.embeddings,c=0;c<b.length;c++){var d=b[c];if(d.tensorName===a)return d}return null};q.retrieveRuns=function(a){a(["Demo"])};
q.retrieveProjectorConfig=function(a,b){var c=this,d=wn("Fetching projector config...");d3.json(this.projectorConfigPath,function(a,f){a?xn(a.responseText):(wn(null,d),c.projectorConfig=f,b(f))})};q.retrieveTensor=function(a,b,c){var d=this.getEmbeddingInfo(b),e=""+d.tensorPath;".bytes"===d.tensorPath.substr(-6)?Yo.retrieveTensorAsBytes(this,this.getEmbeddingInfo(b),a,b,e,c):(wn("Fetching tensors...",Lo.TENSORS_MSG_ID),d3.text(e,function(a,b){a?xn(a.responseText):Yo.parseTensors(b).then(function(a){c(new xo.DataSet(a))})}))};
Expand All @@ -8250,7 +8266,7 @@ <h3>2D controls</h3>
wp.prototype.onMouseDown=function(a,b){this.isMouseDown=!0;this.svgElement.style("display","block");this.startCoordinates=[a,b];this.lastBoundingBox={x:this.startCoordinates[0],y:this.startCoordinates[1],width:1,height:1}};
wp.prototype.onMouseMove=function(a,b){this.isMouseDown&&(this.lastBoundingBox.x=Math.min(a,this.startCoordinates[0]),this.lastBoundingBox.y=Math.max(b,this.startCoordinates[1]),this.lastBoundingBox.width=Math.max(a,this.startCoordinates[0])-this.lastBoundingBox.x,this.lastBoundingBox.height=this.lastBoundingBox.y-Math.min(b,this.startCoordinates[1]),this.rectElement.attr({x:this.lastBoundingBox.x,y:this.lastBoundingBox.y-this.lastBoundingBox.height,width:this.lastBoundingBox.width,height:this.lastBoundingBox.height}))};
wp.prototype.onMouseUp=function(){this.isMouseDown=!1;this.svgElement.style("display","none");this.rectElement.attr("width",0);this.rectElement.attr("height",0);this.selectionCallback(this.lastBoundingBox)};up.ScatterPlotRectangleSelector=wp;function xp(){};var yp={},zp={id:"third_party/tensorflow/tensorboard/components/vz_projector/scatterPlot"},Ap=new THREE.Vector3(.45,.9,1.6),Bp=new THREE.Vector3(0,0,0),Cp=new THREE.Vector3(0,0,4),Dp=new THREE.Vector3(0,0,0);yp.MouseMode={};yp.MouseMode.AREA_SELECT=0;yp.MouseMode.CAMERA_AND_CLICK_SELECT=1;yp.MouseMode[yp.MouseMode.AREA_SELECT]="AREA_SELECT";yp.MouseMode[yp.MouseMode.CAMERA_AND_CLICK_SELECT]="CAMERA_AND_CLICK_SELECT";var Ep=function(){this.orthographic=!1};yp.CameraDef=Ep;function Fp(){}
var Gp=function(a,b){var c=this;this.visualizers=[];this.onCameraMoveListeners=[];this.backgroundColor=16777215;this.dimensionality=3;this.cameraDef=null;this.isDragSequence=this.mouseIsDown=this.selecting=this.orbitAnimationOnNextCameraCreation=!1;this.containerNode=a.node();this.projectorEventContext=b;this.getLayoutValues();this.scene=new THREE.Scene;this.renderer=new THREE.WebGLRenderer({alpha:!0,premultipliedAlpha:!1});this.renderer.setClearColor(16777215,1);this.containerNode.appendChild(this.renderer.domElement);
var Gp=function(a,b){var c=this;this.visualizers=[];this.onCameraMoveListeners=[];this.backgroundColor=16777215;this.dimensionality=3;this.cameraDef=null;this.isDragSequence=this.mouseIsDown=this.selecting=this.orbitAnimationOnNextCameraCreation=!1;this.containerNode=a.node();this.projectorEventContext=b;this.getLayoutValues();this.scene=new THREE.Scene;this.renderer=new THREE.WebGLRenderer({alpha:!0,premultipliedAlpha:!1,antialias:!0});this.renderer.setClearColor(16777215,1);this.containerNode.appendChild(this.renderer.domElement);
this.light=new THREE.PointLight(16772287,1,0);this.scene.add(this.light);this.setDimensions(3);this.recreateCamera(this.makeDefaultCameraDef(this.dimensionality));this.renderer.render(this.scene,this.camera);this.rectangleSelector=new wp(this.containerNode,function(a){return c.selectBoundingBox(a)});this.addInteractionListeners()};q=Gp.prototype;
q.addInteractionListeners=function(){this.containerNode.addEventListener("mousemove",this.onMouseMove.bind(this));this.containerNode.addEventListener("mousedown",this.onMouseDown.bind(this));this.containerNode.addEventListener("mouseup",this.onMouseUp.bind(this));this.containerNode.addEventListener("click",this.onClick.bind(this));window.addEventListener("keydown",this.onKeyDown.bind(this),!1);window.addEventListener("keyup",this.onKeyUp.bind(this),!1)};
q.addCameraControlsEventListeners=function(a){var b=this;a.addEventListener("start",function(){b.stopOrbitAnimation();b.onCameraMoveListeners.forEach(function(c){return c(b.camera.position,a.target)})});a.addEventListener("change",function(){b.render()});a.addEventListener("end",function(){})};
Expand Down
Binary file added preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e24d926

Please sign in to comment.