From c954d624185ed600fcbd65e6d695f55d7940ee1e Mon Sep 17 00:00:00 2001 From: Jan Pfeifer Date: Sun, 18 Feb 2024 11:53:38 +0100 Subject: [PATCH 1/2] Added plotly library; Added LoadScriptModuleAndRun; Bumpted version to 0.9.6. --- Dockerfile | 4 +- docs/CHANGELOG.md | 6 +- examples/tutorial.ipynb | 197 +++++++++++++++++++++++++++++----------- go.mod | 3 +- go.sum | 100 +++++++++++++------- gonbui/gonbui.go | 19 ---- gonbui/javascript.go | 86 ++++++++++++++++++ gonbui/plotly/plotly.go | 48 ++++++++++ 8 files changed, 351 insertions(+), 112 deletions(-) create mode 100644 gonbui/javascript.go create mode 100644 gonbui/plotly/plotly.go diff --git a/Dockerfile b/Dockerfile index e6cb6b8..8b2a17a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,8 +29,8 @@ RUN apt-get install --yes --no-install-recommends git ####################################################################################################### # Go and GoNB Libraries ####################################################################################################### -ENV GO_VERSION=1.21.6 -ENV GONB_VERSION="v0.9.5" +ENV GO_VERSION=1.22 +ENV GONB_VERSION="v0.9.6" ENV GOROOT=/usr/local/go ENV GOPATH=/opt/go ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1432aee..c8f09b2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,12 +1,14 @@ # GoNB Changelog -## Next +## 0.9.6, 2024/02/18 * Fixed some typos in klog formatting. * Updated dependencies. * Updated gopls dependencies: new jsonrpc2 API. +* Added `LoadScriptModuleAndRun`. +* Added [Plotly Javascript](https://plotly.com/javascript/) support, in `gonbui.plotly` package. Also added example in tutorial. -## 0.9.5, 2023/01/10 +## 0.9.5, 2024/01/10 * Added instrumentation to Jupyter input boxes in `nbexec`. * Added functional tests for input boxes created with `%with_inputs`, `%with_password` or `gonbui.RequestInput`. diff --git a/examples/tutorial.ipynb b/examples/tutorial.ipynb index 1dd4ca0..bf0bd2f 100644 --- a/examples/tutorial.ipynb +++ b/examples/tutorial.ipynb @@ -208,8 +208,8 @@ "text": [ "\t...VeryExpensive() call...\n", "\t...VeryExpensive() call...\n", - "NonCachedValue=699\n", - " CachedValue=505\n" + "NonCachedValue=477\n", + " CachedValue=634\n" ] } ], @@ -293,7 +293,7 @@ "name": "stdout", "output_type": "stream", "text": [ - " 100% |████████████████████████████████████████| (25 steps/s) [3s:0s]:0s]\n", + " 100% |████████████████████████████████████████| (25 steps/s) [3s:0s]0s]\n", "Done\n" ] } @@ -413,7 +413,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "lastRenderTime=1.791664\n" + "lastRenderTime=4.672456\n" ] }, { @@ -639,7 +639,7 @@ { "data": { "text/html": [ - "
12345678910X1.02.04.08.016.032.064.0128.0256.0512.0YA diagram of sorts 📊 📈
" + "
12345678910X1.02.04.08.016.032.064.0128.0256.0512.0YA diagram of sorts 📊 📈
" ] }, "metadata": {}, @@ -724,7 +724,7 @@ { "data": { "text/html": [ - "Animated Sine" + "Animated Sine" ] }, "metadata": {}, @@ -991,6 +991,95 @@ "gonbui.DisplaySvg(string(GonumPlotExample(400, 200, \"svg\")))" ] }, + { + "cell_type": "markdown", + "id": "565909db-5b70-442e-a717-2873f21410c5", + "metadata": {}, + "source": [ + "### Plotting with [Plotly](https://plotly.com/)\n", + "\n", + "[Plotly](https://plotly.com/) has really fancy plots, worth exploring for generating exquisite reports.\n", + "\n", + "Currently supported using [`github.com/MetalBlueberry/go-plotly`](https://github.com/MetalBlueberry/go-plotly) library.\n", + "\n", + "**Experimental**: but if you bump into any issues please report, and we'll try to fix it." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "ae872acc-d74d-4215-a7d7-bec772d9c191", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/javascript": [ + "\n", + "(() => {\n", + "\tconst src=\"https://cdn.plot.ly/plotly-2.29.1.min.js\";\n", + "\tvar runJSFn = function() {\n", + "\t\t\n", + "\tlet data = JSON.parse('{\"data\":[{\"type\":\"bar\",\"x\":[1,2,3],\"y\":[1,2,3]}],\"layout\":{\"title\":{\"text\":\"A Figure Specified By Go Struct\"}}}');\n", + "\tPlotly.newPlot('95a71931', data);\n", + "\n", + "\t}\n", + "\t\n", + "\tvar currentScripts = document.head.getElementsByTagName(\"script\");\n", + "\tfor (const idx in currentScripts) {\n", + "\t\tlet script = currentScripts[idx];\n", + "\t\tif (script.src == src) {\n", + "\t\t\trunJSFn();\n", + "\t\t\treturn;\n", + "\t\t}\n", + "\t}\n", + "\n", + "\tvar script = document.createElement(\"script\");\n", + "\n", + "\tscript.charset = \"utf-8\";\n", + "\t\n", + "\tscript.src = src;\n", + "\tscript.onload = script.onreadystatechange = runJSFn\n", + "\tdocument.head.appendChild(script);\t\n", + "})();\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import (\n", + " \"github.com/janpfeifer/gonb/gonbui/plotly\"\n", + " grob \"github.com/MetalBlueberry/go-plotly/graph_objects\"\n", + ")\n", + "\n", + "%%\n", + "fig := &grob.Fig{\n", + " Data: grob.Traces{\n", + " &grob.Bar{\n", + " Type: grob.TraceTypeBar,\n", + " X: []float64{1, 2, 3},\n", + " Y: []float64{1, 2, 3},\n", + " },\n", + " },\n", + " Layout: &grob.Layout{\n", + " Title: &grob.LayoutTitle{\n", + " Text: \"A Figure Specified By Go Struct\",\n", + " },\n", + " },\n", + "}\n", + "plotly.DisplayFig(fig)" + ] + }, { "cell_type": "markdown", "id": "aadf447d-22e4-486f-a749-36834d9bf24c", @@ -1053,7 +1142,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "id": "03452fc9-f43c-4fb1-b1ce-50df961a214d", "metadata": {}, "outputs": [ @@ -1076,7 +1165,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "id": "13a230fd-1179-4ec3-b24c-4f89e0913920", "metadata": {}, "outputs": [ @@ -1108,7 +1197,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "id": "0b8683aa-0bf0-4058-8992-1c5b9e2c2b0c", "metadata": {}, "outputs": [ @@ -1143,7 +1232,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "id": "4e2e9992-3a74-4825-87d8-773bdc30b05f", "metadata": { "tags": [] @@ -1179,7 +1268,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "id": "27c7aaad-b0d3-46f0-b1f6-dc66722fe5bd", "metadata": { "tags": [] @@ -1241,14 +1330,14 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "id": "632205e9-a72c-4e1a-a429-6a02394ce44a", "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
" + "
" ] }, "metadata": {}, @@ -1278,7 +1367,7 @@ { "data": { "text/html": [ - "  5.50 " + "  5.50 " ] }, "metadata": {}, @@ -1287,7 +1376,7 @@ { "data": { "text/html": [ - "Animated Sine" + "Animated Sine" ] }, "metadata": {}, @@ -1412,7 +1501,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "id": "724e33f4-c5fa-4fbe-9d90-e411369a74f3", "metadata": {}, "outputs": [ @@ -1420,13 +1509,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "go version go1.21.2 linux/amd64\n", + "go version go1.22.0 linux/amd64\n", "/home/janpf/Projects/gonb/examples\n", - "total 372\n", - "-rw-r--r-- 1 janpf janpf 162170 Aug 17 11:57 experimental.ipynb\n", - "-rwxr-xr-x 1 janpf janpf 87160 May 22 11:29 google_colab_demo.ipynb\n", - "drwxr-xr-x 3 janpf janpf 4096 Oct 9 09:31 tests\n", - "-rw-r--r-- 1 janpf janpf 110396 Oct 9 09:33 tutorial.ipynb\n", + "total 324\n", + "-rw-r--r-- 1 janpf janpf 2836 Feb 18 11:43 experimental.ipynb\n", + "-rwxr-xr-x 1 janpf janpf 87160 Oct 3 06:38 google_colab_demo.ipynb\n", + "drwxr-xr-x 3 janpf janpf 4096 Jan 24 07:46 tests\n", + "-rw-r--r-- 1 janpf janpf 216361 Feb 18 11:49 tutorial.ipynb\n", + "-rw-r--r-- 1 janpf janpf 1360 Dec 17 15:20 Untitled.ipynb\n", "-rw-r--r-- 1 janpf janpf 10090 Oct 3 11:07 wasm_demo.ipynb\n" ] } @@ -1451,7 +1541,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "id": "be207993-219d-4a7f-a130-5111971fb867", "metadata": {}, "outputs": [ @@ -1459,13 +1549,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "/tmp/gonb_ccbf1af2\n", - "total 13340\n", - "-rw-r--r-- 1 janpf janpf 1449 Oct 9 09:33 go.mod\n", - "-rwxr-xr-x 1 janpf janpf 13631645 Oct 9 09:33 gonb_ccbf1af2\n", - "srwxr-xr-x 1 janpf janpf 0 Oct 9 09:31 gopls_socket\n", - "-rw-r--r-- 1 janpf janpf 10417 Oct 9 09:33 go.sum\n", - "-rw-r--r-- 1 janpf janpf 6160 Oct 9 09:33 main.go\n" + "/tmp/gonb_2ea0783b\n", + "total 13720\n", + "-rw-r--r-- 1 janpf janpf 1443 Feb 18 11:50 go.mod\n", + "-rwxr-xr-x 1 janpf janpf 14018568 Feb 18 11:50 gonb_2ea0783b\n", + "srwxr-xr-x 1 janpf janpf 0 Feb 18 11:49 gopls_socket\n", + "-rw-r--r-- 1 janpf janpf 15814 Feb 18 11:50 go.sum\n", + "-rw-r--r-- 1 janpf janpf 6160 Feb 18 11:50 main.go\n" ] } ], @@ -1485,7 +1575,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "id": "8688859a-ec3b-4e54-99b4-abbd8542091d", "metadata": {}, "outputs": [ @@ -1548,7 +1638,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "id": "02dbf874-ab19-4fb8-8d91-901dadac808c", "metadata": {}, "outputs": [ @@ -1560,10 +1650,10 @@ "--- PASS: TestIncr (0.00s)\n", "goos: linux\n", "goarch: amd64\n", - "pkg: gonb_ccbf1af2\n", - "cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n", + "pkg: gonb_2ea0783b\n", + "cpu: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz\n", "BenchmarkIncr\n", - "BenchmarkIncr-24 \t1000000000\t 0.1030 ns/op\n", + "BenchmarkIncr-8 \t1000000000\t 0.5308 ns/op\n", "PASS\n" ] } @@ -1627,7 +1717,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "id": "3391f12e-131b-45b8-b270-6ba06abaac8c", "metadata": { "tags": [] @@ -1637,20 +1727,21 @@ "name": "stdout", "output_type": "stream", "text": [ - "module gonb_ccbf1af2\n", + "module gonb_2ea0783b\n", "\n", - "go 1.21.2\n", + "go 1.22.0\n", "\n", "replace github.com/janpfeifer/gonb => /home/janpf/Projects/gonb\n", "\n", "require (\n", + "\tgithub.com/MetalBlueberry/go-plotly v0.4.0\n", "\tgithub.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b\n", "\tgithub.com/benc-uk/gofract v0.0.0-20230120162050-a6f644f92fd6\n", "\tgithub.com/erkkah/margaid v0.1.1-0.20230128143048-d60b2efd2f5a\n", - "\tgithub.com/janpfeifer/gonb v0.9.2\n", - "\tgithub.com/schollz/progressbar/v3 v3.13.1\n", + "\tgithub.com/janpfeifer/gonb v0.9.5\n", + "\tgithub.com/schollz/progressbar/v3 v3.14.1\n", "\tgithub.com/stretchr/testify v1.8.1\n", - "\tgolang.org/x/exp v0.0.0-20231006140011-7918f672742d\n", + "\tgolang.org/x/exp v0.0.0-20240213143201-ec583247a57a\n", "\tgonum.org/v1/plot v0.14.0\n", ")\n", "\n", @@ -1660,23 +1751,22 @@ "\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n", "\tgithub.com/go-fonts/liberation v0.3.1 // indirect\n", "\tgithub.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 // indirect\n", - "\tgithub.com/go-logr/logr v1.2.4 // indirect\n", + "\tgithub.com/go-logr/logr v1.4.1 // indirect\n", "\tgithub.com/go-pdf/fpdf v0.8.0 // indirect\n", "\tgithub.com/gofrs/uuid v4.4.0+incompatible // indirect\n", "\tgithub.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect\n", "\tgithub.com/lucasb-eyer/go-colorful v1.0.3 // indirect\n", - "\tgithub.com/mattn/go-runewidth v0.0.14 // indirect\n", "\tgithub.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect\n", "\tgithub.com/pkg/errors v0.9.1 // indirect\n", "\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n", - "\tgithub.com/rivo/uniseg v0.2.0 // indirect\n", + "\tgithub.com/rivo/uniseg v0.4.4 // indirect\n", "\tgolang.org/x/image v0.11.0 // indirect\n", - "\tgolang.org/x/sys v0.13.0 // indirect\n", - "\tgolang.org/x/term v0.6.0 // indirect\n", - "\tgolang.org/x/text v0.12.0 // indirect\n", - "\tgopkg.in/yaml.v2 v2.3.0 // indirect\n", + "\tgolang.org/x/sys v0.16.0 // indirect\n", + "\tgolang.org/x/term v0.14.0 // indirect\n", + "\tgolang.org/x/text v0.14.0 // indirect\n", + "\tgopkg.in/yaml.v2 v2.4.0 // indirect\n", "\tgopkg.in/yaml.v3 v3.0.1 // indirect\n", - "\tk8s.io/klog/v2 v2.100.1 // indirect\n", + "\tk8s.io/klog/v2 v2.120.1 // indirect\n", ")\n" ] } @@ -1700,7 +1790,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "id": "45cf4a12-4b93-480f-bd83-2d375e7a475d", "metadata": { "tags": [] @@ -1746,7 +1836,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "id": "f6d836c1-3dfd-41a0-b097-b157f33289a8", "metadata": { "tags": [] @@ -1764,6 +1854,7 @@ "
  • /home/janpf/Projects/gonb/gonbui
  • \n", "
  • /home/janpf/Projects/gonb/gonbui/comms
  • \n", "
  • /home/janpf/Projects/gonb/gonbui/dom
  • \n", + "
  • /home/janpf/Projects/gonb/gonbui/plotly
  • \n", "
  • /home/janpf/Projects/gonb/gonbui/protocol
  • \n", "
  • /home/janpf/Projects/gonb/gonbui/wasm
  • \n", "
  • /home/janpf/Projects/gonb/gonbui/widgets
  • \n", @@ -1825,7 +1916,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "id": "ba9172b8-ede5-44cd-baa1-a58a1d668a98", "metadata": { "tags": [] @@ -2060,7 +2151,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.21.5" } }, "nbformat": 4, diff --git a/go.mod b/go.mod index 5a51cb7..cc3aad4 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/janpfeifer/gonb go 1.21 require ( + github.com/MetalBlueberry/go-plotly v0.4.0 github.com/fatih/color v1.16.0 github.com/fsnotify/fsnotify v1.7.0 - github.com/go-language-server/jsonrpc2 v0.4.2 github.com/go-language-server/protocol v0.7.0 github.com/go-language-server/uri v0.2.0 github.com/go-rod/rod v0.114.3 @@ -24,6 +24,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/francoispqt/gojay v1.2.13 // indirect + github.com/go-language-server/jsonrpc2 v0.4.2 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-zeromq/goczmq/v4 v4.2.2 // indirect github.com/google/go-cmp v0.5.9 // indirect diff --git a/go.sum b/go.sum index 0e46365..4ef2647 100644 --- a/go.sum +++ b/go.sum @@ -8,9 +8,9 @@ dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1 dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/MetalBlueberry/go-plotly v0.4.0 h1:ld/FLZIwLmPdv09ljANonwEqSoI1uNn7myLYAVjBQ48= +github.com/MetalBlueberry/go-plotly v0.4.0/go.mod h1:TWXjEOVRo7sm3rY3j18cKbbwRrRM3FtxjMxz8fNRsoM= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= @@ -20,16 +20,13 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -42,17 +39,13 @@ github.com/go-language-server/protocol v0.7.0 h1:LbRDvfJZD9fi1/hrIympgA9K7zBLMSz github.com/go-language-server/protocol v0.7.0/go.mod h1:vFd+h5GjPpv0lcgffVWUyUi8VcI4hGnRAJ7D1zkYCaI= github.com/go-language-server/uri v0.2.0 h1:zkFlKR0EYmCg3076hwVbM9/+/Ugr8vMQvQQgoS2JpTo= github.com/go-language-server/uri v0.2.0/go.mod h1:1wEq7lT5PmX5uljJuQJeRxdW06jr5VfA1aR1FKe2/gc= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-rod/rod v0.114.3 h1:gAUT2Bc2wy0tQL5KEet05HNDvmndaHAGCjQ01TB2efA= github.com/go-rod/rod v0.114.3/go.mod h1:aiedSEFg5DwG/fnNbUOTPMTTWX3MRj6vIs/a684Mthw= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-zeromq/goczmq/v4 v4.2.2 h1:HAJN+i+3NW55ijMJJhk7oWxHKXgAuSBkoFfvr8bYj4U= github.com/go-zeromq/goczmq/v4 v4.2.2/go.mod h1:Sm/lxrfxP/Oxqs0tnHD6WAhwkWrx+S+1MRrKzcxoaYE= -github.com/go-zeromq/zmq4 v0.15.0 h1:SLqukpmLTx0JsLaOaCCjwy5eBdfJ+ouJX/677HoFbJM= -github.com/go-zeromq/zmq4 v0.15.0/go.mod h1:sD47DcXifeUFsVTB2ps8ijqTpEuTAlYgfuLoiWEXdCE= github.com/go-zeromq/zmq4 v0.16.0 h1:D6oIPWSdkY/4DJu4tBUmo28P3WRq4F4Ji4/iQ/fJHc0= github.com/go-zeromq/zmq4 v0.16.0/go.mod h1:8c3aXloJBRPba1AqWMJK4vypniM+yC+JKqi8KpRaDFc= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= @@ -62,12 +55,24 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.2-0.20190829225427-b1c9c4891a65/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -82,6 +87,8 @@ github.com/gowebapi/webapi v0.0.0-20221221115732-41cedfc27a0b h1:ziwlwRTFt5kSst3 github.com/gowebapi/webapi v0.0.0-20221221115732-41cedfc27a0b/go.mod h1:idYMKBl+9tqA6sZrzVqN+3XGWANtIRP6CLZsxZOiIFg= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/janpfeifer/must v0.0.2 h1:9e61R0lD/Rs5ZRMUEOss0885JMmEI4KK6thsPfmlgEQ= github.com/janpfeifer/must v0.0.2/go.mod h1:S6c5Yg/YSMR43cJw4zhIq7HFMci90a7kPY9XA4c8UIs= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= @@ -100,8 +107,6 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -110,7 +115,16 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.12.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -122,12 +136,8 @@ github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7q github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc= -github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/segmentio/encoding v0.3.4 h1:WM4IBnxH8B9TakiM2QD5LyNl9JSndh88QbHqVC+Pauc= -github.com/segmentio/encoding v0.3.4/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM= github.com/segmentio/encoding v0.4.0 h1:MEBYvRqiUB2nfR2criEXWqwdY6HJOUrCn5hboVOVmy8= github.com/segmentio/encoding v0.4.0/go.mod h1:/d03Cd8PoaDeceuhUUUQWjU0KhWjrmYrWPgtJHYZSnI= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -161,6 +171,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= @@ -182,6 +193,7 @@ github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE= github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg= github.com/ysmood/leakless v0.8.0 h1:BzLrVoiwxikpgEQR0Lk8NyBN5Cit2b1z+u0mgL4ZJak= github.com/ysmood/leakless v0.8.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.lsp.dev/jsonrpc2 v0.10.0 h1:Pr/YcXJoEOTMc/b6OTmcR1DPJ3mSWl/SWiU1Cct6VmI= go.lsp.dev/jsonrpc2 v0.10.0/go.mod h1:fmEzIdXPi/rf6d4uFcayi8HpFP1nBF99ERP1htC72Ac= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= @@ -193,8 +205,6 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= @@ -203,9 +213,9 @@ golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -213,8 +223,7 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -228,6 +237,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -238,8 +250,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -248,23 +259,29 @@ golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -272,10 +289,12 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -294,13 +313,26 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -309,8 +341,6 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= diff --git a/gonbui/gonbui.go b/gonbui/gonbui.go index 7151d3e..baaa09d 100644 --- a/gonbui/gonbui.go +++ b/gonbui/gonbui.go @@ -450,25 +450,6 @@ func RequestInput(prompt string, password bool) { }) } -// ScriptJavascript executes the given Javascript script in the Notebook. -// -// Errors in javascript parsing are sent by Jupyter Server to the stderr -- as opposed to showing -// to the browser console, which may be harder to debug. -// -// Also, like with DisplayHtml, each execution creates a new `
    ` block in the output area. -// Even if empty, it uses up a bit of vertical space (Jupyter Notebook thing). -// -// If these are an issue, consider using TransientJavascript, which uses a transient area -// to execute the Javascript, which is re-used for every execution. -func ScriptJavascript(js string) { - if !IsNotebook { - return - } - SendData(&protocol.DisplayData{ - Data: map[protocol.MIMEType]any{protocol.MIMETextJavascript: js}, - }) -} - // EmbedImageAsPNGSrc returns a string that can be used as in an HTML tag, as its source (it's `src` field). // This simplifies embedding an image in HTML without requiring separate files. It embeds it as a PNG file // base64 encoded. diff --git a/gonbui/javascript.go b/gonbui/javascript.go new file mode 100644 index 0000000..56f7b89 --- /dev/null +++ b/gonbui/javascript.go @@ -0,0 +1,86 @@ +package gonbui + +import ( + "bytes" + "github.com/janpfeifer/gonb/gonbui/protocol" + "github.com/pkg/errors" + "text/template" +) + +// ScriptJavascript executes the given Javascript script in the Notebook. +// +// Errors in javascript parsing are sent by Jupyter Server to the stderr -- as opposed to showing +// to the browser console, which may be harder to debug. +// +// Also, like with DisplayHtml, each execution creates a new `
    ` block in the output area. +// Even if empty, it uses up a bit of vertical space (Jupyter Notebook thing). +// +// If these are an issue, consider using TransientJavascript, which uses a transient area +// to execute the Javascript, which is re-used for every execution. +func ScriptJavascript(js string) { + if !IsNotebook { + return + } + SendData(&protocol.DisplayData{ + Data: map[protocol.MIMEType]any{protocol.MIMETextJavascript: js}, + }) +} + +var loadAndRunTmpl = template.Must(template.New("load_and_run").Parse(` +(() => { + const src="{{.Src}}"; + var runJSFn = function() { + {{.RunJS}} + } + + var currentScripts = document.head.getElementsByTagName("script"); + for (const idx in currentScripts) { + let script = currentScripts[idx]; + if (script.src == src) { + runJSFn(); + return; + } + } + + var script = document.createElement("script"); +{{range $key, $value := .Attributes}} + script.{{$key}} = "{{$value}}"; +{{end}} + script.src = src; + script.onload = script.onreadystatechange = runJSFn + document.head.appendChild(script); +})(); +`)) + +// LoadScriptModuleAndRun loads the given script module and, `onLoad`, runs the given code. +// +// If the module has been previously loaded, it immediately runs the given code. +// +// The script module given is appended to the `HEAD` of the page. +// +// Extra `attributes` can be given, and will be appended to the `script` node. +// +// Example: to make sure Plotly Javascript (https://plotly.com/javascript/) is loaded -- +// please check Plotly's installation directions for the latest version. +// +// gonbui.LoadScriptModuleAndRun( +// "https://cdn.plot.ly/plotly-2.29.1.min.js", {"charset": "utf-8"}, +// "console.log('Plotly loaded.')); +func LoadScriptModuleAndRun(src string, attributes map[string]string, runJS string) error { + var buf bytes.Buffer + data := struct { + Src, RunJS string + Attributes map[string]string + }{ + Src: src, + RunJS: runJS, + Attributes: attributes, + } + err := loadAndRunTmpl.Execute(&buf, data) + if err != nil { + return errors.Wrapf(err, "failed to execut template for LoadScriptModuleRun()") + } + js := buf.String() + ScriptJavascript(js) + return nil +} diff --git a/gonbui/plotly/plotly.go b/gonbui/plotly/plotly.go new file mode 100644 index 0000000..f2f3717 --- /dev/null +++ b/gonbui/plotly/plotly.go @@ -0,0 +1,48 @@ +// Package plotly adds barebones support to Plotly (https://plotly.com/javascript/getting-started/) +// library. +// +// It's a simple wrapper to execute javascript code, assuming the Plotly library is loaded. +// +// It also offers a library around github.com/MetalBlueberry/go-plotly (itself a wrapper around +// Plotly) to integrate it in GoNB, see `DisplayFig` method. +// +// API is a first stab at it (experimental), and `UpdateHtml` for dynamic plots is not yet supported. +// Ideas are welcome here. +package plotly + +import ( + "encoding/json" + "fmt" + grob "github.com/MetalBlueberry/go-plotly/graph_objects" + "github.com/janpfeifer/gonb/gonbui" + "github.com/pkg/errors" +) + +// PlotlySrc is the source from where to download Plotly. +// If you have a local copy or an updated version of the library, change the value here. +var PlotlySrc = "https://cdn.plot.ly/plotly-2.29.1.min.js" + +// DisplayFig as HTML output. +func DisplayFig(fig *grob.Fig) error { + // Create a unique div. + divId := gonbui.UniqueId() + gonbui.DisplayHTML(fmt.Sprintf(`
    `, divId)) + + // Encode figure. + figBytes, err := json.Marshal(fig) + if err != nil { + return errors.Wrapf(err, "failed to marshal Json to use with plotly") + } + + // Run in plotly. + runJS := fmt.Sprintf(` + let data = JSON.parse('%s'); + Plotly.newPlot('%s', data); +`, figBytes, divId) + + err = gonbui.LoadScriptModuleAndRun(PlotlySrc, map[string]string{"charset": "utf-8"}, runJS) + if err != nil { + return err + } + return nil +} From 5acc2a31f55d02d48cbd6bb126c17c43d3faa589 Mon Sep 17 00:00:00 2001 From: Jan Pfeifer Date: Sun, 18 Feb 2024 12:00:03 +0100 Subject: [PATCH 2/2] Updated coverage. --- docs/coverage.txt | 9 +++++---- examples/tests/bash_script.ipynb | 6 +++--- examples/tests/comms.ipynb | 2 +- examples/tests/dom.ipynb | 6 +++--- examples/tests/functions.ipynb | 2 +- examples/tests/goflags.ipynb | 12 ++++++------ examples/tests/gonbui.ipynb | 4 ++-- examples/tests/gotest.ipynb | 18 +++++++++--------- examples/tests/gowork.ipynb | 18 +++++++++--------- examples/tests/hello.ipynb | 2 +- examples/tests/init.ipynb | 2 +- examples/tests/input_boxes.ipynb | 4 ++-- examples/tests/widgets.ipynb | 8 ++++---- 13 files changed, 47 insertions(+), 46 deletions(-) diff --git a/docs/coverage.txt b/docs/coverage.txt index 7de3e3b..50260b7 100644 --- a/docs/coverage.txt +++ b/docs/coverage.txt @@ -79,8 +79,9 @@ github.com/janpfeifer/gonb/gonbui/gonbui.go DisplayImage 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go DisplaySvg 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go DisplaySVG 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go RequestInput 75.0% -github.com/janpfeifer/gonb/gonbui/gonbui.go ScriptJavascript 0.0% github.com/janpfeifer/gonb/gonbui/gonbui.go EmbedImageAsPNGSrc 0.0% +github.com/janpfeifer/gonb/gonbui/javascript.go ScriptJavascript 0.0% +github.com/janpfeifer/gonb/gonbui/javascript.go LoadScriptModuleAndRun 0.0% github.com/janpfeifer/gonb/gonbui/comms/comms.go init 100.0% github.com/janpfeifer/gonb/gonbui/comms/comms.go Start 0.0% github.com/janpfeifer/gonb/gonbui/comms/comms.go Send 100.0% @@ -158,7 +159,7 @@ github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.ProgramSubscrib github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.ProgramUnsubscribeRequest 57.1% github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.deliverProgramSubscriptionsLocked 62.5% github.com/janpfeifer/gonb/internal/dispatcher/comms.go handleComms 55.6% -github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go RunKernel 77.1% +github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go RunKernel 80.0% github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleShellMsg 71.0% github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleBusyMessage 47.8% github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleShutdownRequest 83.3% @@ -253,7 +254,7 @@ github.com/janpfeifer/gonb/internal/goexec/parser.go *State.SetCellTests 10 github.com/janpfeifer/gonb/internal/goexec/parser.go *State.DefaultCellTestArgs 100.0% github.com/janpfeifer/gonb/internal/goexec/tracking.go newTrackingInfo 100.0% github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.Track 100.0% -github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.lockedTrack 54.8% +github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.lockedTrack 69.4% github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.Untrack 85.7% github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.lockedUntrackEntry 66.7% github.com/janpfeifer/gonb/internal/goexec/tracking.go *State.ListTracked 80.0% @@ -396,4 +397,4 @@ github.com/janpfeifer/gonb/internal/specialcmd/track.go execTrack 27.3% github.com/janpfeifer/gonb/internal/specialcmd/track.go execUntrack 54.5% github.com/janpfeifer/gonb/internal/specialcmd/track.go showTrackedList 91.7% github.com/janpfeifer/gonb/internal/websocket/websocket.go Javascript 83.3% -total (statements) 64.1% +total (statements) 64.2% diff --git a/examples/tests/bash_script.ipynb b/examples/tests/bash_script.ipynb index fc4d836..6f7b1c8 100644 --- a/examples/tests/bash_script.ipynb +++ b/examples/tests/bash_script.ipynb @@ -34,7 +34,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "/tmp/gonb_2f6c813c\n" + "/tmp/gonb_9dda40ab\n" ] } ], @@ -59,7 +59,7 @@ "output_type": "stream", "text": [ "/home/janpf/Projects/gonb/examples/tests\n", - "/tmp/gonb_2f6c813c\n", + "/tmp/gonb_9dda40ab\n", "/home/janpf/Projects/gonb\n", "/home/janpf/Projects/gonb\n" ] @@ -86,7 +86,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/comms.ipynb b/examples/tests/comms.ipynb index 561d781..8dcb8a2 100644 --- a/examples/tests/comms.ipynb +++ b/examples/tests/comms.ipynb @@ -308,7 +308,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/dom.ipynb b/examples/tests/dom.ipynb index d35cfa5..72f17e7 100644 --- a/examples/tests/dom.ipynb +++ b/examples/tests/dom.ipynb @@ -88,7 +88,7 @@ { "data": { "text/html": [ - "
    " + "
    " ] }, "metadata": {}, @@ -152,7 +152,7 @@ { "data": { "text/html": [ - "
    " + "
    " ] }, "metadata": {}, @@ -197,7 +197,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/functions.ipynb b/examples/tests/functions.ipynb index cd525b7..594dc89 100644 --- a/examples/tests/functions.ipynb +++ b/examples/tests/functions.ipynb @@ -65,7 +65,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/goflags.ipynb b/examples/tests/goflags.ipynb index 2d74860..b546e1f 100644 --- a/examples/tests/goflags.ipynb +++ b/examples/tests/goflags.ipynb @@ -153,9 +153,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "gonb_020f1df5/main.go:8:\tA\t\t100.0%\n", - "gonb_020f1df5/main.go:12:\tB\t\t0.0%\n", - "gonb_020f1df5/main.go:17:\tmain\t\t100.0%\n", + "gonb_bc1385f7/main.go:8:\tA\t\t100.0%\n", + "gonb_bc1385f7/main.go:12:\tB\t\t0.0%\n", + "gonb_bc1385f7/main.go:17:\tmain\t\t100.0%\n", "total\t\t\t\t(statements)\t75.0%\n" ] } @@ -238,14 +238,14 @@ "name": "stderr", "output_type": "stream", "text": [ - "# gonb_020f1df5\n", + "# gonb_bc1385f7\n", "./main.go:10:6: can inline (*Point).ManhattanLen\n", "./main.go:16:12: inlining call to flag.Parse\n", "./main.go:18:28: inlining call to (*Point).ManhattanLen\n", "./main.go:18:13: inlining call to fmt.Println\n", "./main.go:10:7: p does not escape\n", "./main.go:18:13: ... argument does not escape\n", - "./main.go:18:28: ~R0 escapes to heap\n" + "./main.go:18:28: ~r0 escapes to heap\n" ] } ], @@ -267,7 +267,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/gonbui.ipynb b/examples/tests/gonbui.ipynb index fa13ccc..5eaa375 100644 --- a/examples/tests/gonbui.ipynb +++ b/examples/tests/gonbui.ipynb @@ -22,7 +22,7 @@ "output_type": "stream", "text": [ "%goflags=[\"--cover\" \"--covermode=set\"]\n", - "GOCOVERDIR=/tmp/gonb_test_coverage.4btcckxYms\n" + "GOCOVERDIR=/tmp/gonb_test_coverage.4mPvyGK2OJ\n" ] } ], @@ -133,7 +133,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/gotest.ipynb b/examples/tests/gotest.ipynb index 195c335..7828e19 100644 --- a/examples/tests/gotest.ipynb +++ b/examples/tests/gotest.ipynb @@ -287,12 +287,12 @@ "text": [ "goos: linux\n", "goarch: amd64\n", - "pkg: gonb_ce0aec45\n", - "cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n", + "pkg: gonb_36f3efc5\n", + "cpu: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz\n", "BenchmarkFibonacciA32\n", - "BenchmarkFibonacciA32-24 \t 157\t 7665168 ns/op\n", + "BenchmarkFibonacciA32-8 \t 50\t 22759741 ns/op\n", "BenchmarkFibonacciB32\n", - "BenchmarkFibonacciB32-24 \t298868374\t 3.914 ns/op\n", + "BenchmarkFibonacciB32-8 \t28774705\t 39.85 ns/op\n", "PASS\n", "coverage: [no statements]\n" ] @@ -334,10 +334,10 @@ "text": [ "goos: linux\n", "goarch: amd64\n", - "pkg: gonb_ce0aec45\n", - "cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n", - "BenchmarkFibonacciA32-24 \t 156\t 7601541 ns/op\n", - "BenchmarkFibonacciB32-24 \t302442891\t 3.894 ns/op\n", + "pkg: gonb_36f3efc5\n", + "cpu: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz\n", + "BenchmarkFibonacciA32-8 \t 52\t 22831751 ns/op\n", + "BenchmarkFibonacciB32-8 \t31159093\t 40.49 ns/op\n", "PASS\n", "coverage: [no statements]\n" ] @@ -361,7 +361,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/gowork.ipynb b/examples/tests/gowork.ipynb index 53d179e..1ace7a5 100644 --- a/examples/tests/gowork.ipynb +++ b/examples/tests/gowork.ipynb @@ -36,7 +36,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "/tmp/gonb_tests_gowork_6mPoRnnx" + "/tmp/gonb_tests_gowork_0srvuOWg" ] } ], @@ -64,7 +64,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Temporary test package: /tmp/gonb_tests_gowork_6mPoRnnx\n" + "Temporary test package: /tmp/gonb_tests_gowork_0srvuOWg\n" ] } ], @@ -136,7 +136,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_6mPoRnnx\".\n" + "\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_0srvuOWg\".\n" ] } ], @@ -155,9 +155,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "module gonb_19fe2324\n", + "module gonb_5cff895d\n", "\n", - "go 1.21.6\n", + "go 1.22.0\n", "\n", "replace a.com/a/pkg => TMP_PKG\n" ] @@ -186,7 +186,7 @@ "text/html": [ "List of files/directories being tracked:\n", "
      \n", - "
    • /tmp/gonb_tests_gowork_6mPoRnnx
    • \n", + "
    • /tmp/gonb_tests_gowork_0srvuOWg
    • \n", "
    \n" ] }, @@ -208,9 +208,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "module gonb_19fe2324\n", + "module gonb_5cff895d\n", "\n", - "go 1.21.6\n" + "go 1.22.0\n" ] } ], @@ -280,7 +280,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/hello.ipynb b/examples/tests/hello.ipynb index bcb7e3e..eff25e3 100644 --- a/examples/tests/hello.ipynb +++ b/examples/tests/hello.ipynb @@ -51,7 +51,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/init.ipynb b/examples/tests/init.ipynb index 6f594f7..fb227a9 100644 --- a/examples/tests/init.ipynb +++ b/examples/tests/init.ipynb @@ -156,7 +156,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/input_boxes.ipynb b/examples/tests/input_boxes.ipynb index d3936f6..e930d15 100644 --- a/examples/tests/input_boxes.ipynb +++ b/examples/tests/input_boxes.ipynb @@ -22,7 +22,7 @@ "output_type": "stream", "text": [ "%goflags=[\"--cover\" \"--covermode=set\"]\n", - "GOCOVERDIR=/tmp/gonb_test_coverage.4btcckxYms\n" + "GOCOVERDIR=/tmp/gonb_test_coverage.4mPvyGK2OJ\n" ] } ], @@ -196,7 +196,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4, diff --git a/examples/tests/widgets.ipynb b/examples/tests/widgets.ipynb index 0e0a59c..0ef8a65 100644 --- a/examples/tests/widgets.ipynb +++ b/examples/tests/widgets.ipynb @@ -95,7 +95,7 @@ { "data": { "text/html": [ - "
    " + "
    " ] }, "metadata": {}, @@ -189,7 +189,7 @@ { "data": { "text/html": [ - "
    " + "
    " ] }, "metadata": {}, @@ -304,7 +304,7 @@ { "data": { "text/html": [ - "
    " + "
    " ] }, "metadata": {}, @@ -416,7 +416,7 @@ "name": "go", "nbconvert_exporter": "", "pygments_lexer": "", - "version": "go1.21.6" + "version": "go1.22.0" } }, "nbformat": 4,