Skip to content

Commit 9106a91

Browse files
committed
update
1 parent fe3c1ad commit 9106a91

14 files changed

Lines changed: 810 additions & 256 deletions

assets/css/main.css

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
body {
22
font-family: Helvetica Neue, sans-serif;
3+
user-select: none;
34
}
45

56
.editCat {
@@ -85,6 +86,8 @@ body {
8586

8687
}
8788

89+
90+
8891
#catData {
8992
width: 30%;
9093
margin-left: 2%;
@@ -417,6 +420,7 @@ canvas {
417420
left: 550px;
418421
background-color: #424242;
419422
color: #fff;
423+
z-index: 99;
420424

421425

422426
}
@@ -489,24 +493,32 @@ table th {
489493
width: 75px;
490494
}
491495

496+
.paletteName {
497+
display: flex;
498+
}
499+
500+
#palettePlusMark {
501+
filter: invert(1);
502+
}
492503

493504
.waypointTitle {
505+
background-color: #424242 !important;
494506
font-weight: 600;
495507
text-align: left;
496-
margin-left: 29px;
497-
color: #333;
508+
margin-left: 10px;
509+
color: #fff;
498510
border-radius: 0 !important;
499511
border: none !important;
500512
border-color: #333;
501513
border-bottom: 1px solid !important;;
502514
/*padding: 5px 10px !important;*/
503515
padding: 5px 2px !important;
504516
outline: none !important;
505-
width: 15%;
506-
font-size: 20pt;
517+
/*width: 15%;*/
518+
font-size: 14pt;
507519
margin-right: 10px;
508-
margin-top: 14px;
509520
min-width: 90px;
521+
height: 27px !important;
510522
}
511523

512524
#sampledMarks canvas {
@@ -767,16 +779,17 @@ li .fakeGrammarRow {
767779

768780
.exportPaletteBtn {
769781
cursor: pointer;
770-
width: 50px;
782+
width: 32px;
771783
padding: 0;
772784
height: 29px;
773-
margin-top: 35px;
785+
/*margin-top: 35px;*/
774786
}
775787

776788
.exportPaletteBtn img {
777789
transform: scaleX(-1);
778790
width: 21px;
779791
height: 21px;
792+
filter: invert(1);
780793
}
781794

782795
.canPreview {
@@ -859,7 +872,7 @@ p, h3, h4, h5, img {
859872
width: 32px;
860873
height: 35px;
861874
background-color: inherit;
862-
left: -22px;
875+
left: -12px;
863876
border-radius: 5px;
864877
transition: .5s;
865878
}
@@ -870,11 +883,11 @@ p, h3, h4, h5, img {
870883
}
871884

872885
#AllPaletteCont {
873-
overflow-y: auto;
874-
height: 74vh;
886+
overflow-y: scroll;
887+
height: 50vh;
875888
width: 300px;
876-
-ms-overflow-style: none; /* Internet Explorer 10+ */
877-
scrollbar-width: none; /* Firefox, Safari 18.2+, Chromium 121+ */
889+
/*-ms-overflow-style: none; !* Internet Explorer 10+ *!*/
890+
/*scrollbar-width: none; !* Firefox, Safari 18.2+, Chromium 121+ *!*/
878891
/*border: 1px solid #555;*/
879892
}
880893

@@ -915,8 +928,53 @@ p, h3, h4, h5, img {
915928
border-radius: 10px;
916929
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
917930
padding: 20px;
931+
z-index: 99;
918932
}
919933

920-
#svgDisplay image{
934+
#sampleDisplay image{
921935
pointer-events: all;
936+
937+
}
938+
939+
#sampleDisplay .sample {
940+
outline: solid 1px #424242;
941+
}
942+
943+
.LassoControls {
944+
cursor: pointer;
945+
}
946+
947+
.LassoControls circle {
948+
fill: rgba(244, 244, 244, 0.9);
949+
stroke-width: 2px;
950+
stroke: #222
951+
}
952+
953+
.LassoControls:hover {
954+
fill: rgba(244, 244, 244, 0.5);
955+
}
956+
957+
958+
#composition path:hover {
959+
960+
stroke-width: 6px ;
961+
cursor: pointer;
962+
963+
}
964+
965+
#composition circle:hover {
966+
967+
r: 9px ;
968+
cursor: grab;
969+
970+
971+
}
972+
.dataRow {
973+
display: flex;
974+
justify-content: center;
975+
}
976+
977+
.dataColumn {
978+
font-weight: 600;
979+
text-decoration: underline;
922980
}

assets/js/AllPalettes.js

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,20 @@ async function initAllPalette() {
7676
let tPalCont = document.getElementById("paletteCont")
7777

7878

79-
tPalCont.onmouseover= function (e) {
79+
tPalCont.onmouseover = function (e) {
8080
if (dragging) {
8181

82-
this.classList.add("draggedover");
82+
this.classList.add("draggedover");
8383
}
8484
}
8585

86-
tPalCont.onmouseleave= function (e) {
86+
tPalCont.onmouseleave = function (e) {
8787
if (dragging) {
8888
this.classList.remove("draggedover");
8989
}
9090
}
9191

9292

93-
9493
}
9594

9695

@@ -169,4 +168,57 @@ function openNav() {
169168
}
170169

171170

171+
}
172+
173+
174+
function appendSingle(palette,name) {
175+
const container = document.getElementById("AllPaletteCont");
176+
177+
178+
palSources.push(name)
179+
180+
console.log(palette);
181+
182+
let tdiv = document.createElement("div");
183+
tdiv.className = "allPaletteRow";
184+
tdiv.setAttribute("number", palSources.length-1)
185+
tdiv.setAttribute("name", name)
186+
187+
let canContainer = document.createElement("div");
188+
tdiv.innerHTML = `<p>${name}</p>`;
189+
canContainer.className = "canPreview";
190+
191+
tdiv.appendChild(canContainer);
192+
container.appendChild(tdiv);
193+
194+
dragElement(tdiv)
195+
let allMarks = palette.encodings.range.marks;
196+
197+
let MarkNames = Object.keys(allMarks)
198+
let n = MarkNames.length;
199+
let offx = 14
200+
let offy = 3
201+
202+
if (offx * n + subW > prevW || offy * n + subH > prevH) {
203+
offx = (prevW - subW) / n
204+
offy = (prevH - subH) / n
205+
}
206+
canContainer.style.width = prevW + "px"
207+
canContainer.style.height = prevH + "px"
208+
209+
for (let j = n - 1; j > -1; j--) {
210+
211+
let tcan = cloneCanvas(allMarks[MarkNames[j]].proto.canvas)
212+
tcan.style.width = `${subW}px`
213+
tcan.style.height = `${subH}px`
214+
215+
tcan.style.left = `${offx + (j * offx)}px`
216+
tcan.style.top = `${(prevH - subH) - (j * offy)}px`
217+
218+
219+
canContainer.appendChild(tcan);
220+
221+
allPalettes.push(palette)
222+
}
223+
172224
}

assets/js/canvasSampleHandler.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ async function addRectSample(x, y, width, height) {
157157

158158

159159
sampleData.push(tres)
160-
/*
161-
let marks = document.getElementById("marks")
160+
/*
161+
let marks = document.getElementById("marks")
162162
163-
marks.append(tcan)*/
163+
marks.append(tcan)*/
164164

165165
tcont.drawImage(currImg,
166166
Math.round(dp.rx * currImg.width),
@@ -172,7 +172,10 @@ async function addRectSample(x, y, width, height) {
172172
dp.width,
173173
dp.height);
174174

175+
let svg = d3.select("#sampleDisplay")
176+
175177
fillSvg(sampleData)
178+
showControls(svg, [tres.x -25, tres.y-25], tcan)
176179
}
177180

178181

@@ -181,7 +184,7 @@ async function addGrabSample(x, y, width, height) {
181184

182185
let coords = curateCoordinates(x, y, width, height);
183186

184-
otherGrab(coords);
187+
// otherGrab(coords);
185188

186189
let can = document.getElementById("inVis")
187190
let trec = can.getBoundingClientRect()
@@ -403,9 +406,9 @@ async function addFreeSample(points) {
403406
)
404407

405408

406-
/* let marks = document.getElementById("marks")
409+
/* let marks = document.getElementById("marks")
407410
408-
marks.append(tcan)*/
411+
marks.append(tcan)*/
409412
sampleData.push(tres)
410413
fillSvg(sampleData)
411414
}

assets/js/collageHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let options_type = {}
22
let displayedMarks = {}
3-
let dataList = {}
3+
// let dataList = {}
44

55

66
function populateSelect() {

0 commit comments

Comments
 (0)