Skip to content
Permalink
Browse files

update

  • Loading branch information
jamesb93 committed Oct 9, 2019
1 parent bd3497d commit c7e495cd7e0866c7909bb6adc5ee461055be8039
@@ -8,18 +8,24 @@ bookFlatSection: false
## Clustering
This plot shows how clustering can be used with colours in chart.js

{{< reduc-chart "umap7-1.json" >}}
{{< waveform "/audio/testin.wav" >}}
{{< waveform "/audio/sine2.wav" >}}
{{< waveform "/audio/fluid.wav" >}}
{{< waveform "https://f000.backblazeb2.com/file/jbr-audio-backup/data-audio/fluid.wav">}}


{{< chart-reduc "umap7-1.json" >}}
UMAP Dimensionality Reduction with Neighbours=7 and Mindist=0.1
{{< /reduc-chart >}}
{{< /chart-reduc >}}

{{< reduc-chart "umap7-75.json" >}}
{{< chart-reduc "umap7-75.json" >}}
UMAP Dimensionality Reduction with Neighbours=15 and Mindist = 0.75
{{< /reduc-chart >}}
{{< /chart-reduc >}}

{{< reduc-chart "umap15-1.json" >}}
{{< chart-reduc "umap15-1.json" >}}
UMAP Dimensionality Reduction with Neighbours=15 and Mindist = 0.1
{{< /reduc-chart >}}
{{< /chart-reduc >}}


{{< button relref="/" >}}Home{{< /button >}}
{{< button href="https://github.com/jamesb93/data_bending" >}}Github{{< /button >}}

File renamed without changes.
@@ -0,0 +1,47 @@
{{ if not (.Page.Scratch.Get "chartjs") }}
<script src="{{ "/js/Chart.min.js" | relURL }}"></script>
{{ .Page.Scratch.Set "chartjs" true }}
{{ end }}

{{ if not (.Page.Scratch.Get "jquery") }}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
{{ .Page.Scratch.Set "jquery" true }}
{{ end }}

{{ $id := substr (md5 .Inner) 0 16 }}

<canvas id='{{$id}}' width="400" height="400"></canvas>
<script type="text/javascript">
$.getJSON("/plots/{{ index .Params 0 | safeJS }}", function(json) {
var ctx = document.getElementById('{{$id | safeJS}}').getContext('2d');
var scatterChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
pointRadius: 0.5,
data: json.data,
pointBackgroundColor: "#000000"
}]
},
options: {
title: {
display: true,
text: "{{ .Inner }}"
},
tooltip: {
enabled:false
},
legend: {
display: false
},
animation: false,
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
}
});
});
</script>
@@ -1,21 +1,36 @@
{{ if not (.Page.Scratch.Get "wavesurfer") }}
<script src="https://unpkg.com/wavesurfer.js"></script>
<script src="/js/wavesurfer.min.js"></script>
{{ .Page.Scratch.Set "wavesurfer" true }}
{{ end }}

<div id="waveform">
{{ if not (.Page.Scratch.Get "waveform") }}
{{ .Page.Scratch.Set "waveform" 1}}
{{ else }}
{{ .Page.Scratch.Add "waveform" 1 }}
{{ end }}
{{ $num := .Page.Scratch.Get "waveform"}}
{{ $id := (printf "wavesurfer_%d" $num)}}

<div id="waveform_{{ .Page.Scratch.Get "waveform"}}" align="left">
<script type="text/javascript">
var x = WaveSurfer.create({
container: document.querySelector('#waveform'),
var {{$id | safeJS}} = WaveSurfer.create({
container: document.querySelector('#waveform_{{ .Page.Scratch.Get "waveform" }}'),
barGap: 0,
barWidth: 1,
barHeight: 1, // the height of the wave
barGap: null
cursorColor: "#4f76d1",
cursorWidth: 2,
progressColor: "#4f76d1",
skipLength: 9999,
waveColor: "#00000"
});

x.load("/audio/{{ index .Params 0 }}");
{{$id | safeJS}}.load("{{ index .Params 0 }}");
</script>
<button class="btn btn-primary" data-action="play" onclick="x.playPause()">Play | Pause</button>
<button class="book-btn" onclick="{{$id | safeJS}}.playPause()" data-action="play">Play/Pause</button>
<button class="book-btn" onclick="{{$id | safeJS}}.skipBackward()" data-action="back">Restart</button>
</div>





@@ -0,0 +1,7 @@
{
"folders": [
{
"path": "."
}
]
}

Large diffs are not rendered by default.

@@ -1 +1 @@
{"Target":"book.min.a27472133bc56fabe2709272398db43010a6c80f6f9e361943a285287f11659b.css","MediaType":"text/css","Data":{"Integrity":"sha256-onRyEzvFb6vicJJyOY20MBCmyA9vnjYZQ6KFKH8RZZs="}}
{"Target":"book.min.12d3e3b1c76fd787e699903442f11e678c9bb005cb488d6834444c0d8f4bee50.css","MediaType":"text/css","Data":{"Integrity":"sha256-EtPjscdv14fmmZA0QvEeZ4ybsAXLSI1oNERMDY9L7lA="}}
BIN +1.48 MB static/audio/fluid.wav
Binary file not shown.
File renamed without changes.

Large diffs are not rendered by default.

0 comments on commit c7e495c

Please sign in to comment.
You can’t perform that action at this time.