-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invisible lines 🐛 #149
Comments
Adding "revs_with_datapoints": ["a", "b"] to |
@mattseddon could you please take a look when you have time, seems to be related to the new anchors that we have. |
The behaviour is expected. To be completely honest I didn't think that anyone was using this package directly (i.e. outside of DVC). I can add a patch for the behaviour when |
@jsappl Can you explain how you are using it and why you want to do so without |
First of all, thank you for addressing the issue so promptly. I am using
I came across this issue while training a model and generating the HTML report using """Minimal working example with Live."""
from dvclive import Live
with Live(report="html") as live:
for y in range(2):
live.log_metric("y", y)
live.next_step() Generated HTML report. <!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="5" />
<title>DVC Plot</title>
<script src="https://cdn.jsdelivr.net/npm/vega@5.20.2"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.2.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6.18.2"></script>
<style>
table {
border-spacing: 15px;
}
</style>
</head>
<body>
<div id="metrics_json" style="text-align: center; padding: 10x">
<p>metrics_json</p>
<div style="display: flex; justify-content: center">
<table>
<thead>
<tr>
<th style="text-align: right">y</th>
<th style="text-align: right">step</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right">1</td>
<td style="text-align: right">1</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="static_y">
<script type="text/javascript">
var spec = {
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
data: {
values: [
{ step: "0", y: "0", rev: "workspace" },
{ step: "1", y: "1", rev: "workspace" },
],
},
title: "y",
width: 300,
height: 300,
params: [
{
name: "smooth",
value: 0.001,
bind: { input: "range", min: 0.001, max: 1, step: 0.001 },
},
],
encoding: {
x: { field: "step", type: "quantitative", title: "step" },
color: { field: "rev", scale: { domain: [], range: [] } },
strokeDash: {},
},
layer: [
{
layer: [
{
params: [
{ name: "grid", select: "interval", bind: "scales" },
],
mark: "line",
},
{
transform: [{ filter: { param: "hover", empty: false } }],
mark: "point",
},
],
encoding: {
y: {
field: "y",
type: "quantitative",
title: "y",
scale: { zero: false },
},
color: { field: "rev", type: "nominal" },
},
transform: [
{
loess: "y",
on: "step",
groupby: ["rev"],
bandwidth: { signal: "smooth" },
},
],
},
{
mark: { type: "line", opacity: 0.2 },
encoding: {
x: { field: "step", type: "quantitative", title: "step" },
y: {
field: "y",
type: "quantitative",
title: "y",
scale: { zero: false },
},
color: { field: "rev", type: "nominal" },
},
},
{
mark: { type: "circle", size: 10 },
encoding: {
x: {
aggregate: "max",
field: "step",
type: "quantitative",
title: "step",
},
y: {
aggregate: { argmax: "step" },
field: "y",
type: "quantitative",
title: "y",
scale: { zero: false },
},
color: { field: "rev", type: "nominal" },
},
},
{
transform: [
{ calculate: "datum.rev", as: "pivot_field" },
{ pivot: "pivot_field", value: "y", groupby: ["step"] },
],
mark: {
type: "rule",
tooltip: { content: "data" },
stroke: "grey",
},
encoding: {
opacity: {
condition: { value: 0.3, param: "hover", empty: false },
value: 0,
},
},
params: [
{
name: "hover",
select: {
type: "point",
fields: ["step"],
nearest: true,
on: "mouseover",
clear: "mouseout",
},
},
],
},
],
};
vegaEmbed("#static_y", spec);
</script>
</div>
</body>
</html> |
Which operating system and Python version are you using?
Which version of this project are you using?
dvc-render 1.0.0
What did you do?
What did you expect to see?
Two lines colored according to revs
a
andb
.What did you see instead?
Nothing, lines were invisible.
HTML that was produced using
render_html
.Problem Source
I managed to boil it down to this.
After removing the empty
scale
field the HTML plot was working as intended.The text was updated successfully, but these errors were encountered: