You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d45bb80
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: v3/docs/opt-trace-format.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,28 @@ is that `trace.length` is the number of execution steps that the frontend render
125
125
126
126
Ok, still with me? Let's now dig into what an individual element in `trace` looks like.
127
127
128
+
## Interlude: Viewing a trace in the OPT frontend
129
+
130
+
To view a trace locally on your computer without setting up a Webserver, load up `v3/demo.html` in your browser.
131
+
Now create a trace file called `v3/test-trace.js`, which contains a single trace variable like so:
132
+
133
+
```javascript
134
+
var trace = { ... your trace object ... };
135
+
```
136
+
137
+
Now reload `v3/demo.html`, and if everything works out, it will create a new visualization using the trace in the `trace`
138
+
variable from `v3/test-trace.js`. I use this technique as a quick way of testing out what different traces look like
139
+
without setting up a server.
140
+
141
+
**If you open up your browser console, you will see the current trace entry being printed out as you step through the
142
+
visualization, which can help you debug.**
143
+
144
+
P.S. to create a trace file in the appropriate format using the defaault OPT Python frontend, run `generate_json_trace.py` using the `--create_jsvar` option:
0 commit comments