Skip to content

Commit

Permalink
click
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobetic committed Mar 28, 2024
1 parent 810d2dd commit 632ed8c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

### coin2html

- console log data on click
- tooltips for columns, inputs and wherever useful
- show details of selected posting
- add location info
Expand Down
3 changes: 2 additions & 1 deletion cmd/coin2html/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,8 @@ function viewChart(
.attr("y", (d) => y(d.date))
.attr("x", (d) => x(d.offset ?? 0))
.attr("width", (d) => x(d.width ?? 0))
.attr("height", rowHeight - 1);
.attr("height", rowHeight - 1)
.on("click", (e, d) => console.log(e, d));

// bar text
layer
Expand Down
4 changes: 4 additions & 0 deletions cmd/coin2html/js/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ td.amount {
font-family: sans-serif;
font-size: 11px;
}

.layer rect:hover {
fill: gray;
}
7 changes: 6 additions & 1 deletion examples/yearly/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
font-size: 11px;
}

.layer rect:hover {
fill: gray;
}

</style>
</head>
<body>
Expand Down Expand Up @@ -47003,7 +47007,8 @@ <h1>
.attr("y", (d) => y(d.date))
.attr("x", (d) => x(d.offset ?? 0))
.attr("width", (d) => x(d.width ?? 0))
.attr("height", rowHeight - 1);
.attr("height", rowHeight - 1)
.on("click", (e, d) => console.log(e, d));
// bar text
layer
.selectAll("text")
Expand Down

0 comments on commit 632ed8c

Please sign in to comment.