Skip to content

Commit eee857a

Browse files
committed
Demo: Updated sample code
- Demo: Updated basic example to reflect parameter for option overrides - Styles: Removed some dead code, slightly increased size of label background rectangles
1 parent 0bffe6c commit eee857a

File tree

7 files changed

+10
-313
lines changed

7 files changed

+10
-313
lines changed

demo/demo.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/demo.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ <h4>Basic example</h4>
3434
<code class="language-javascript">const tag = TAG.tag({
3535
container: "container-id",
3636
data: {...},
37-
format: "odin"
37+
format: "odin",
38+
options: {
39+
showTopArgLabels: true
40+
}
3841
});</code></pre>
3942

4043
<div id="basicContainer" style="border: solid 1px lightgray"></div>

demo/src/demo.scss

Lines changed: 0 additions & 306 deletions
Original file line numberDiff line numberDiff line change
@@ -73,310 +73,4 @@ svg, svg text {
7373
svg text {
7474
cursor: default;
7575
user-select: none;
76-
}
77-
78-
// -------------------
79-
80-
#fill {
81-
/* ensure body takes up entire window */
82-
position: absolute;
83-
z-index: -1;
84-
top: 0;
85-
left: 0;
86-
width: 100%;
87-
height: 100%;
88-
}
89-
90-
body.full-demo {
91-
margin: 0;
92-
-moz-osx-font-smoothing: grayscale;
93-
-webkit-font-smoothing: antialiased;
94-
font-family: BrownPro, Brown, futura, helvetica, arial, sans-serif;
95-
/*font-size: 11px;*/
96-
min-height: 100%;
97-
overflow-y: scroll;
98-
}
99-
100-
#header {
101-
position: fixed;
102-
z-index: 100;
103-
width: 100%;
104-
padding: 10px 20px;
105-
background-image: linear-gradient(to top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), white, white);
106-
/*background:rgba(255,255,255,0.5);*/
107-
top: 0;
108-
color: #777;
109-
font: 14px/1.5em helvetica, arial, sans-serif;
110-
}
111-
112-
body.full-demo header > div {
113-
float: right;
114-
display: inline-block;
115-
background: inherit;
116-
position: relative;
117-
}
118-
119-
#dataset,
120-
body.full-demo header > button {
121-
color: inherit;
122-
background: none;
123-
outline: none;
124-
cursor: pointer;
125-
font: inherit;
126-
border: none;
127-
padding: 0;
128-
margin: 10px;
129-
}
130-
131-
#dataset {
132-
display: inline-block;
133-
height: 40px;
134-
background-color: white;
135-
border: 1px solid #ddd;
136-
transition: background 200ms ease;
137-
}
138-
139-
#dataset:hover {
140-
background: #fafafa;
141-
}
142-
143-
body.full-demo header > button:hover {
144-
border-bottom: 1px solid grey;
145-
}
146-
147-
/* input */
148-
#input-modal {
149-
}
150-
151-
#input-modal textarea {
152-
width: 100%;
153-
height: 300px;
154-
padding: 5px;
155-
font-size: 15px;
156-
}
157-
158-
body.full-demo label[for="file-input"] {
159-
padding: 10px 15px;
160-
cursor: pointer;
161-
background: steelblue;
162-
color: white;
163-
margin: 10px 0;
164-
display: inline-block;
165-
border-radius: 5px;
166-
}
167-
168-
/* modal */
169-
.modal-tag {
170-
color: #222;
171-
background: rgba(0, 0, 0, 0.3);
172-
width: 100%;
173-
height: 100%;
174-
top: 0;
175-
left: 0;
176-
position: fixed;
177-
z-index: 1000;
178-
display: none;
179-
}
180-
181-
.modal-tag.open {
182-
display: block;
183-
}
184-
185-
.modal-tag > div {
186-
background: hsl(5, 5%, 98%);
187-
margin: 10vh auto;
188-
width: 80%;
189-
max-width: 700px;
190-
height: 80vh;
191-
border-radius: 6px;
192-
box-shadow: 0 0 20px black;
193-
font-size: 14px;
194-
line-height: 1.5em;
195-
}
196-
197-
.modal-tag header {
198-
padding: 0 1em;
199-
background: white;
200-
white-space: nowrap;
201-
overflow-x: auto;
202-
cursor: move;
203-
box-shadow: 0 0 1em rgba(0, 0, 0, 0.15);
204-
}
205-
206-
.modal-tag header .tab {
207-
background: hsl(5, 5%, 85%);
208-
display: inline-block;
209-
margin-top: 0.8em;
210-
padding: 0.5em 1em;
211-
cursor: pointer;
212-
border-radius: 3px 3px 0 0;
213-
border: 1px solid hsl(5, 5%, 85%);
214-
border-bottom: none;
215-
text-transform: uppercase;
216-
font-size: 0.85em;
217-
letter-spacing: 0.03em;
218-
color: #555;
219-
}
220-
221-
.modal-tag header .tab.active {
222-
color: #222;
223-
background: hsl(5, 5%, 98%);
224-
}
225-
226-
.modal-tag .page {
227-
position: relative;
228-
padding: 2em;
229-
padding-top: 0.5em;
230-
display: none;
231-
height: calc(100% - 5.6em);
232-
overflow-y: auto;
233-
}
234-
235-
.modal-tag .page.active {
236-
display: block;
237-
}
238-
239-
.modal-tag svg {
240-
width: 100%;
241-
height: 100%;
242-
position: absolute;
243-
top: 0;
244-
left: 0;
245-
}
246-
247-
#toggle-taxonomy {
248-
font-size: 0.9em;
249-
text-decoration: underline;
250-
cursor: pointer;
251-
color: steelblue;
252-
float: right;
253-
}
254-
255-
#taxonomy > ul {
256-
list-style-type: none;
257-
padding: 0;
258-
margin: 0;
259-
}
260-
261-
#taxonomy > ul ul {
262-
list-style-type: none;
263-
padding: 0;
264-
padding-left: 1.5em;
265-
}
266-
267-
#taxonomy li {
268-
margin-top: 0.5em;
269-
margin-bottom: 0.5em;
270-
}
271-
272-
#taxonomy input[type="checkbox"] {
273-
margin-right: 0.5em;
274-
}
275-
276-
#taxonomy input.colorpicker {
277-
margin-left: 0.5em;
278-
width: 5em;
279-
text-align: center;
280-
display: inline-block;
281-
outline: none;
282-
border: 1px solid transparent;
283-
padding: 0.4em;
284-
border-radius: 3px;
285-
cursor: pointer;
286-
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
287-
text-transform: uppercase;
288-
-moz-osx-font-smoothing: initial;
289-
-webkit-font-smoothing: initial;
290-
}
291-
292-
#taxonomy input.colorpicker[disabled="true"] {
293-
border-color: #ccc;
294-
box-shadow: none;
295-
pointer-events: none;
296-
opacity: 0.5;
297-
}
298-
299-
#taxonomy input.colorpicker:focus {
300-
border-color: white;
301-
}
302-
303-
body.full-demo > #tree-svg {
304-
border-top: 1px solid #ccc;
305-
/*box-shadow: 0 0 1em #aaa;*/
306-
background: hsl(5, 5%, 98%);
307-
position: fixed;
308-
bottom: 0;
309-
font-size: 14px;
310-
height: 200px;
311-
width: 100%;
312-
max-height: 40vh;
313-
}
314-
315-
body.full-demo {
316-
margin-bottom: 200px;
317-
}
318-
319-
body.tree-closed {
320-
margin-bottom: 0;
321-
}
322-
323-
body.tree-closed > #tree-svg {
324-
display: none;
325-
}
326-
327-
body.full-demo > #tree-svg #tree-close {
328-
display: inline-block;
329-
}
330-
331-
#tree-close {
332-
display: none;
333-
}
334-
335-
#tree-popout, #tree-close {
336-
font-size: 0.9em;
337-
text-decoration: underline;
338-
cursor: pointer;
339-
fill: steelblue;
340-
}
341-
342-
#tooltip {
343-
width: 175px;
344-
background: hsl(40, 10%, 98%);
345-
margin-bottom: 10px;
346-
box-shadow: 0 0 10px #555;
347-
border-radius: 3px;
348-
position: absolute;
349-
padding: 8px 0;
350-
font: 14px helvetica, arial, sans-serif;
351-
font-weight: 400;
352-
color: #444;
353-
display: none;
354-
z-index: 100;
355-
}
356-
357-
#tooltip.active {
358-
display: block;
359-
}
360-
361-
#tooltip p {
362-
padding: 4px 14px;
363-
margin: 0;
364-
cursor: default;
365-
}
366-
367-
#tooltip p:hover {
368-
background-color: rgb(77, 157, 250);
369-
color: white;
370-
}
371-
372-
#tooltip hr {
373-
border-width: 0;
374-
border-top: 1px solid #ddd;
375-
}
376-
377-
/* svg styles for main vis */
378-
#main {
379-
margin-top: 100px;
380-
margin-bottom: 20px;
381-
position: relative;
38276
}

dist/tag/css/tag.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tag/css/tag.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/css/tag.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
.link-text-bg {
8585
fill: #ffffff;
86-
stroke-width: 2px;
86+
stroke-width: 3px;
8787
stroke: #ffffff;
8888
}
8989

0 commit comments

Comments
 (0)