flammarion 0.1.7pre → 0.1.7pre2

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -170,3 +170,5 @@ They are:
170
170
  * [jquery transit](http://ricostacruz.com/jquery.transit/)
171
171
  * [leaflet](http://leafletjs.com/)
172
172
  * [font awesome](https://fortawesome.github.io/Font-Awesome/)
173
+ * [emojione](http://emojione.com/)
174
+ * [Plotly](htps://plot.ly/)
@@ -1,3 +1,3 @@
1
1
  module Flammarion
2
- VERSION = "0.1.7pre"
2
+ VERSION = "0.1.7pre2"
3
3
  end
@@ -50,12 +50,13 @@ module Flammarion
50
50
  end
51
51
 
52
52
  def plot(data, options = {})
53
- unless data.respond_to?(:keys)
54
- data = {y:data, x:(1..data.size).to_a}
55
- else
53
+ if data.respond_to?(:keys)
56
54
  options = options.merge(data)
55
+ data = [data]
56
+ elsif not data.first.respond_to?(:keys)
57
+ data = [{y:data, x:(1..data.size).to_a}.merge(options)]
57
58
  end
58
- @engraving.send_json({action:'plot', id:@id, target:@target, data:[{type:'scatter'}.merge(data)]}.merge(options))
59
+ @engraving.send_json({action:'plot', id:@id, target:@target, data:data}.merge(options))
59
60
  end
60
61
  end
61
62
 
@@ -124,24 +125,11 @@ module Flammarion
124
125
  end
125
126
 
126
127
  # Creates a new plot to display single axis data
127
- # @param [Array<Number>] values A list of numbers to plot
128
128
  # @macro add_options
129
- # @option options [Integer] :number_of_ticks The number of tick marks to
130
- # display across the bottom
131
- # @option options [Integer] :tick_precision The number of digits after the
132
- # decimal point to display next to the tick marks
133
- # @option options [Float] :xstart (0.0) The starting value for the x-axis
134
- # @option options [Float, String] :ystart ('min') The starting value for the
135
- # y-axis. Can be 'min' to start at the minimum value.
136
- # @option options [Boolean] :draw_zero (true) draw a line through y = 0
137
- # @option options [Boolean] :draw_mark (false) place a + at each point on
138
- # the line.
139
- # @option options [Boolean] :draw_line (true) draw a line through all the
140
- # points.
141
- # @option options [Boolean] :fill (false) fill in the area between the curve
142
- # and zero
143
- # @note You can press 'a' while hovering the plot to reset the zoom.
144
129
  # @return [Plot] A Plot object for manipulation after creation.
130
+ # @overload plot(array, options)
131
+ # @param [Array<Number>] values A list of numbers to plot
132
+ # @overload plot(dataset, options)
145
133
  def plot(data, options = {})
146
134
  id = @engraving.make_id
147
135
  p = Plot.new(id, @pane_name, @engraving)
@@ -197,7 +197,7 @@ return"undefined"!=typeof b&&""!==b&&b in a.jsEscapeMap?(d=a.jsEscapeMap[b],e=a.
197
197
  }
198
198
  });
199
199
  }
200
- emojione.imagePathPNG = '/images/emoji/';
200
+ emojione.imagePathPNG = 'images/emoji/';
201
201
  if (options.escape_icons) {
202
202
  text = emojione.toImage(text);
203
203
  }
@@ -6863,7 +6863,7 @@ window.font_awesome_list = ["glass","music","search","envelope-o","heart","star"
6863
6863
  }
6864
6864
  });
6865
6865
  }
6866
- emojione.imagePathPNG = '/images/emoji/';
6866
+ emojione.imagePathPNG = 'images/emoji/';
6867
6867
  if (options.escape_icons) {
6868
6868
  text = emojione.toImage(text);
6869
6869
  }
@@ -7402,6 +7402,9 @@ window.font_awesome_list = ["glass","music","search","envelope-o","heart","star"
7402
7402
  return Plotly.newPlot(plotDiv[0], data.data, $.extend({
7403
7403
  width: plotDiv.width()
7404
7404
  }, window.default_plot_options, data));
7405
+ } else {
7406
+ plotDiv[0].data = data.data;
7407
+ return Plotly.redraw(plotDiv[0]);
7405
7408
  }
7406
7409
  }
7407
7410
  });
@@ -197,7 +197,7 @@ return"undefined"!=typeof b&&""!==b&&b in a.jsEscapeMap?(d=a.jsEscapeMap[b],e=a.
197
197
  }
198
198
  });
199
199
  }
200
- emojione.imagePathPNG = '/images/emoji/';
200
+ emojione.imagePathPNG = 'images/emoji/';
201
201
  if (options.escape_icons) {
202
202
  text = emojione.toImage(text);
203
203
  }
@@ -197,7 +197,7 @@ return"undefined"!=typeof b&&""!==b&&b in a.jsEscapeMap?(d=a.jsEscapeMap[b],e=a.
197
197
  }
198
198
  });
199
199
  }
200
- emojione.imagePathPNG = '/images/emoji/';
200
+ emojione.imagePathPNG = 'images/emoji/';
201
201
  if (options.escape_icons) {
202
202
  text = emojione.toImage(text);
203
203
  }
@@ -45,6 +45,9 @@
45
45
  return Plotly.newPlot(plotDiv[0], data.data, $.extend({
46
46
  width: plotDiv.width()
47
47
  }, window.default_plot_options, data));
48
+ } else {
49
+ plotDiv[0].data = data.data;
50
+ return Plotly.redraw(plotDiv[0]);
48
51
  }
49
52
  }
50
53
  });
@@ -197,7 +197,7 @@ return"undefined"!=typeof b&&""!==b&&b in a.jsEscapeMap?(d=a.jsEscapeMap[b],e=a.
197
197
  }
198
198
  });
199
199
  }
200
- emojione.imagePathPNG = '/images/emoji/';
200
+ emojione.imagePathPNG = 'images/emoji/';
201
201
  if (options.escape_icons) {
202
202
  text = emojione.toImage(text);
203
203
  }
@@ -3459,7 +3459,7 @@ hr {
3459
3459
  }
3460
3460
  #plot-style {
3461
3461
  color: #eee;
3462
- background-color: #323539;
3462
+ background-color: #1d1f21;
3463
3463
  }
3464
3464
  #plot-style .tickmarks {
3465
3465
  color: #a7a7a7;
@@ -22,7 +22,7 @@
22
22
  }
23
23
  #plot-style {
24
24
  color: #eee;
25
- background-color: #323539;
25
+ background-color: #1d1f21;
26
26
  }
27
27
  #plot-style .tickmarks {
28
28
  color: #a7a7a7;
@@ -31,3 +31,6 @@ $.extend WSClient.prototype.actions,
31
31
  @__parent.add(plotDiv, target, data)
32
32
  console.log(default_plot_options)
33
33
  Plotly.newPlot(plotDiv[0], data.data, $.extend(width: plotDiv.width(), window.default_plot_options, data))
34
+ else
35
+ plotDiv[0].data = data.data
36
+ Plotly.redraw(plotDiv[0])
@@ -80,7 +80,7 @@ class WSClient
80
80
  if options.escape_icons
81
81
  text = text.replace /:[\w-]+:/g, (match) ->
82
82
  if font_awesome_list.includes(match[1..-2]) then "<i class='fa fa-#{match[1..-2]}'></i>" else match
83
- emojione.imagePathPNG = '/images/emoji/'
83
+ emojione.imagePathPNG = 'images/emoji/'
84
84
  text = emojione.toImage(text) if options.escape_icons
85
85
  text = $("<div>#{text}</div>")
86
86
  text.find("a[href^='http']").attr('target','_blank')
@@ -27,7 +27,7 @@
27
27
  // index.html.slim for this to take effect.
28
28
  #plot-style
29
29
  color $fg-color
30
- background-color activate($bg-color, 10%)
30
+ background-color activate($bg-color, 0%)
31
31
  & .tickmarks
32
32
  color activate($fg-color, 30%)
33
33
  & .markers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7pre
4
+ version: 0.1.7pre2
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-05 00:00:00.000000000 Z
12
+ date: 2016-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubame