From 924d89666fd0427437e6ae5b42e46699cfe75521 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 8 Mar 2016 03:31:04 +0300 Subject: plots: get rid of JavaScript --- _includes/header.html | 7 +- css/plots.css | 2 +- js/common.js | 23 --- plots.html | 447 +++++++++++++++++++------------------------------- 4 files changed, 174 insertions(+), 305 deletions(-) delete mode 100644 js/common.js diff --git a/_includes/header.html b/_includes/header.html index 060becb..66ed5fc 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -11,9 +11,14 @@ - + {% if page.custom_css %} + {% for css in page.custom_css %} + + {% endfor %} + {% endif %} + {% include ie_compat.html %} diff --git a/css/plots.css b/css/plots.css index ad4f244..7ed222d 100644 --- a/css/plots.css +++ b/css/plots.css @@ -1,3 +1,3 @@ -#plots a.thumbnail { +a.thumbnail { margin-bottom: 0; } diff --git a/js/common.js b/js/common.js deleted file mode 100644 index 07268f4..0000000 --- a/js/common.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 Egor Tensin -// This file is licensed under the terms of the MIT License. -// See LICENSE.txt for details. - -if (!String.prototype.format) { - String.prototype.format = function() { - var str = this.toString(); - if (!arguments.length) - return str; - switch (typeof arguments[0]) { - case 'string': - case 'number': - var args = arguments; - break; - default: - var args = arguments[0]; - break; - } - for (var arg in args) - str = str.replace(new RegExp('\\{' + arg + '\\}', 'gi'), args[arg]); - return str; - } -} diff --git a/plots.html b/plots.html index a91a7a6..939c675 100644 --- a/plots.html +++ b/plots.html @@ -4,6 +4,116 @@ layout: plots groups: - navbar navbar_link:  Plots +custom_css: plots.css +plot_kinds: + - sorted + - randomized + - reversed +plots: + - codename: bubble + brief_name: Bubble sort + display_name: Bubble sort + min_length: 0 + max_length: 200 + repetitions: + sorted: 1000 + randomized: 100 + reversed: 100 + complexity: + sorted: O(n) + randomized: O(n2) + reversed: O(n2) + - codename: bubble_optimized + brief_name: "… \"optimized\"" + display_name: "\"Optimized\" bubble sort" + min_length: 0 + max_length: 200 + repetitions: + sorted: 1000 + randomized: 100 + reversed: 100 + complexity: + sorted: O(n) + randomized: O(n2) + reversed: O(n2) + - codename: heap + brief_name: Heapsort + display_name: Heapsort + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: O(n log n) + - codename: insertion + brief_name: Insertion sort + display_name: Insertion sort + min_length: 0 + max_length: 200 + repetitions: + sorted: 1000 + randomized: 100 + reversed: 100 + complexity: + sorted: O(n) + randomized: O(n2) + reversed: O(n2) + - codename: merge + brief_name: Merge sort + display_name: Merge sort + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: O(n log n) + - codename: quick_first + brief_name: Quicksort (first element as pivot) + display_name: Quicksort (first element as pivot) + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: + sorted: O(n2) + randomized: O(n log n) + reversed: O(n2) + - codename: quick_second + brief_name: "… second element…" + display_name: Quicksort (second element as pivot) + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: + sorted: O(n2) + randomized: O(n log n) + reversed: O(n2) + - codename: quick_middle + brief_name: "… middle element…" + display_name: Quicksort (middle element as pivot) + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: O(n log n) + - codename: quick_last + brief_name: "… last element…" + display_name: Quicksort (last element as pivot) + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: + sorted: O(n2) + randomized: O(n log n) + reversed: O(n2) + - codename: quick_random + brief_name: "… random element…" + display_name: Quicksort (random element as pivot) + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: O(n log n) + - codename: selection + brief_name: Selection sort + display_name: Selection sort + min_length: 0 + max_length: 200 + repetitions: 100 + complexity: O(n2) ---

Plots

@@ -28,286 +138,63 @@ navbar_link:  Plots -
-

Javascript-generated plot table is supposed to appear here.

+{% if page.plots and page.plots != empty %} +
+
+ + + + + + + + {% for kind in page.plot_kinds %} + + {% endfor %} + + + +{% for algorithm in page.plots %} + + + {% for kind in page.plot_kinds %} + + {% endfor %} + +{% endfor %} + +
AlgorithmComplexity
{{ kind }}
{{ algorithm.brief_name }}{% if algorithm.complexity[kind] %}{{ algorithm.complexity[kind] }}{% else %}{{ algorithm.complexity }}{% endif %}
+
- +{% else %} +

Sorry, there're no plots yet.

+
+{% endif %} -- cgit v1.2.3