Skip to content

Commit

Permalink
Merge pull request #354 from Visual-Intelligence-UMN/matrix-reusability
Browse files Browse the repository at this point in the history
Matrix reusability
  • Loading branch information
chongwei729 authored Oct 4, 2024
2 parents 9988098 + 86db98c commit 323d48e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/utils/matEventsUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function detailedViewRecovery(
translateLayers(4, -300);
}


d3.selectAll("path.crossConnection").style("opacity", 0.05);
d3.select(".mats").selectAll(".lastLayerConnections").style("opacity", 0.25);
d3.selectAll(".twoLayer").style("opacity", 1);
d3.select(".pooling").style("opacity", 1);
Expand Down Expand Up @@ -669,11 +669,14 @@ export function featureVisClick(
delay: initSec + aniSec,
},
{func: ()=>{
let drawLabel = true;
if(oFeatureChannels==34)drawLabel = false;
injectPlayButtonSVG(
btn,
btnX,
btnY - 30,
"./assets/SVGs/matmul.svg"
"./assets/SVGs/matmul.svg",
drawLabel
);
//drawHintLabel(g, btnX, btnY - 36, "Click for Animation", "procVis");

Expand Down Expand Up @@ -1122,6 +1125,8 @@ export function outputVisClick(
{func:()=>{
pathMap = drawPathInteractiveComponents(resultStartCoord, resultCoord, result, myColor);
d3.select(".mats").style("pointer-events", "auto");
d3.select(".switchBtn").style("pointer-events", "auto");
d3.select(".switchBtn").style("opacity", 1);
}, delay:200}
]

Expand Down Expand Up @@ -1157,8 +1162,7 @@ export function outputVisClick(
d3.selectAll("path").lower();
//d3.selectAll(".procVis").transition().duration(1000).attr("opacity", 1);
d3.selectAll("path").lower();
d3.select(".switchBtn").style("pointer-events", "auto");
d3.select(".switchBtn").style("opacity", 1);

}, delay:aniSec},
];
AnimationController.runAnimations(0, animateSeqAfterPath);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/svgUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { formulaClass, formulaTextClass } from "./const";
import { drawHintLabel } from "./matHelperUtils";

//a specific function for SVG injection for play-pause button
export function injectPlayButtonSVG(btn:any, btnX: number, btnY: number, SVGPath:string){
export function injectPlayButtonSVG(btn:any, btnX: number, btnY: number, SVGPath:string, drawLabel: boolean = true){
btn.selectAll("*").remove();
const textLabel = btn.append("g")
d3.xml(SVGPath).then(function(data) {
Expand All @@ -19,7 +19,7 @@ export function injectPlayButtonSVG(btn:any, btnX: number, btnY: number, SVGPath
});
});

drawHintLabel(textLabel, btnX - 20, btnY - 5, "Matrix Multiplication", "procVis", "12px");
if(drawLabel)drawHintLabel(textLabel, btnX - 20, btnY - 5, "Matrix Multiplication", "procVis", "12px");
}

//a specific function for SVG injection for play-pause button for graph view
Expand Down

0 comments on commit 323d48e

Please sign in to comment.