ntcharts 0.1.0-aarch64-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +332 -0
- data/ext/ntcharts/barchart.c +215 -0
- data/ext/ntcharts/extconf.rb +70 -0
- data/ext/ntcharts/extension.c +44 -0
- data/ext/ntcharts/extension.h +92 -0
- data/ext/ntcharts/linechart.c +341 -0
- data/ext/ntcharts/sparkline.c +161 -0
- data/ext/ntcharts/streamlinechart.c +183 -0
- data/ext/ntcharts/style.c +77 -0
- data/ext/ntcharts/timeserieslinechart.c +296 -0
- data/ext/ntcharts/wavelinechart.c +248 -0
- data/go/barchart.go +356 -0
- data/go/build/linux_arm64/libntcharts.a +0 -0
- data/go/build/linux_arm64/libntcharts.h +276 -0
- data/go/go.mod +32 -0
- data/go/go.sum +51 -0
- data/go/linechart.go +441 -0
- data/go/ntcharts.go +279 -0
- data/go/sparkline.go +194 -0
- data/go/streamlinechart.go +234 -0
- data/go/timeserieslinechart.go +354 -0
- data/go/wavelinechart.go +309 -0
- data/lib/ntcharts/3.2/ntcharts.so +0 -0
- data/lib/ntcharts/3.3/ntcharts.so +0 -0
- data/lib/ntcharts/3.4/ntcharts.so +0 -0
- data/lib/ntcharts/4.0/ntcharts.so +0 -0
- data/lib/ntcharts/bar_data.rb +51 -0
- data/lib/ntcharts/version.rb +5 -0
- data/lib/ntcharts.rb +102 -0
- data/ntcharts.gemspec +36 -0
- metadata +91 -0
data/lib/ntcharts.rb
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "ntcharts/version"
|
|
4
|
+
|
|
5
|
+
begin
|
|
6
|
+
major, minor, _patch = RUBY_VERSION.split(".")
|
|
7
|
+
require_relative "ntcharts/#{major}.#{minor}/ntcharts"
|
|
8
|
+
rescue LoadError
|
|
9
|
+
require_relative "ntcharts/ntcharts"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
require_relative "ntcharts/bar_data"
|
|
13
|
+
|
|
14
|
+
module Ntcharts
|
|
15
|
+
class Error < StandardError; end
|
|
16
|
+
|
|
17
|
+
# Helper method to convert Lipgloss::Style to Ntcharts::Style
|
|
18
|
+
# This allows using Lipgloss::Style objects directly with ntcharts
|
|
19
|
+
def self.convert_style(style)
|
|
20
|
+
return style if style.is_a?(Ntcharts::Style)
|
|
21
|
+
|
|
22
|
+
raise ArgumentError, "Expected Ntcharts::Style or Lipgloss::Style, got #{style.class}" unless style.respond_to?(:get_foreground) && style.respond_to?(:get_background) && style.respond_to?(:bold?)
|
|
23
|
+
|
|
24
|
+
ntcharts_style = Ntcharts::Style.new
|
|
25
|
+
|
|
26
|
+
fg = style.get_foreground
|
|
27
|
+
bg = style.get_background
|
|
28
|
+
|
|
29
|
+
ntcharts_style = ntcharts_style.foreground(fg) if fg
|
|
30
|
+
ntcharts_style = ntcharts_style.background(bg) if bg
|
|
31
|
+
ntcharts_style = ntcharts_style.bold(style.bold?) if style.bold?
|
|
32
|
+
|
|
33
|
+
ntcharts_style
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
module StyleSetters
|
|
37
|
+
def style=(value)
|
|
38
|
+
_set_style(Ntcharts.convert_style(value))
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def axis_style=(value)
|
|
42
|
+
_set_axis_style(Ntcharts.convert_style(value))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def label_style=(value)
|
|
46
|
+
_set_label_style(Ntcharts.convert_style(value))
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
class Barchart
|
|
51
|
+
include StyleSetters
|
|
52
|
+
|
|
53
|
+
def push(bar_data)
|
|
54
|
+
data = case bar_data
|
|
55
|
+
when BarData then bar_data
|
|
56
|
+
when Hash then BarData.new(**bar_data)
|
|
57
|
+
else raise ArgumentError, "Expected BarData or Hash"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
_push(data)
|
|
61
|
+
|
|
62
|
+
self
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def push_all(bar_data_array)
|
|
66
|
+
data = bar_data_array.map do |d|
|
|
67
|
+
case d
|
|
68
|
+
when BarData then d
|
|
69
|
+
when Hash then BarData.new(**d)
|
|
70
|
+
else raise ArgumentError, "Expected BarData or Hash"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
_push_all(data)
|
|
74
|
+
self
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def render
|
|
78
|
+
draw
|
|
79
|
+
view
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class Sparkline
|
|
84
|
+
include StyleSetters
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class Linechart
|
|
88
|
+
include StyleSetters
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class Wavelinechart
|
|
92
|
+
include StyleSetters
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class Streamlinechart
|
|
96
|
+
include StyleSetters
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
class Timeserieslinechart
|
|
100
|
+
include StyleSetters
|
|
101
|
+
end
|
|
102
|
+
end
|
data/ntcharts.gemspec
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/ntcharts/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "ntcharts"
|
|
7
|
+
spec.version = Ntcharts::VERSION
|
|
8
|
+
spec.authors = ["Marco Roth"]
|
|
9
|
+
spec.email = ["marco.roth@intergga.ch"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Ruby wrapper for NimbleMarkets' ntcharts terminal charting library."
|
|
12
|
+
spec.description = spec.summary
|
|
13
|
+
spec.homepage = "https://github.com/marcoroth/ntcharts-ruby"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
spec.required_ruby_version = ">= 3.2.0"
|
|
16
|
+
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/marcoroth/ntcharts-ruby"
|
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/marcoroth/ntcharts-ruby/releases"
|
|
20
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
21
|
+
|
|
22
|
+
spec.files = Dir[
|
|
23
|
+
"ntcharts.gemspec",
|
|
24
|
+
"LICENSE.txt",
|
|
25
|
+
"README.md",
|
|
26
|
+
"lib/**/*.rb",
|
|
27
|
+
"ext/**/*.{c,h,rb}",
|
|
28
|
+
"go/**/*.{go,mod,sum}",
|
|
29
|
+
"go/build/**/*"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
spec.require_paths = ["lib"]
|
|
33
|
+
spec.extensions = ["ext/ntcharts/extconf.rb"]
|
|
34
|
+
|
|
35
|
+
spec.add_dependency "rake-compiler", "~> 1.2"
|
|
36
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ntcharts
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: aarch64-linux-gnu
|
|
6
|
+
authors:
|
|
7
|
+
- Marco Roth
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rake-compiler
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '1.2'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '1.2'
|
|
26
|
+
description: Ruby wrapper for NimbleMarkets' ntcharts terminal charting library.
|
|
27
|
+
email:
|
|
28
|
+
- marco.roth@intergga.ch
|
|
29
|
+
executables: []
|
|
30
|
+
extensions: []
|
|
31
|
+
extra_rdoc_files: []
|
|
32
|
+
files:
|
|
33
|
+
- README.md
|
|
34
|
+
- ext/ntcharts/barchart.c
|
|
35
|
+
- ext/ntcharts/extconf.rb
|
|
36
|
+
- ext/ntcharts/extension.c
|
|
37
|
+
- ext/ntcharts/extension.h
|
|
38
|
+
- ext/ntcharts/linechart.c
|
|
39
|
+
- ext/ntcharts/sparkline.c
|
|
40
|
+
- ext/ntcharts/streamlinechart.c
|
|
41
|
+
- ext/ntcharts/style.c
|
|
42
|
+
- ext/ntcharts/timeserieslinechart.c
|
|
43
|
+
- ext/ntcharts/wavelinechart.c
|
|
44
|
+
- go/barchart.go
|
|
45
|
+
- go/build/linux_arm64/libntcharts.a
|
|
46
|
+
- go/build/linux_arm64/libntcharts.h
|
|
47
|
+
- go/go.mod
|
|
48
|
+
- go/go.sum
|
|
49
|
+
- go/linechart.go
|
|
50
|
+
- go/ntcharts.go
|
|
51
|
+
- go/sparkline.go
|
|
52
|
+
- go/streamlinechart.go
|
|
53
|
+
- go/timeserieslinechart.go
|
|
54
|
+
- go/wavelinechart.go
|
|
55
|
+
- lib/ntcharts.rb
|
|
56
|
+
- lib/ntcharts/3.2/ntcharts.so
|
|
57
|
+
- lib/ntcharts/3.3/ntcharts.so
|
|
58
|
+
- lib/ntcharts/3.4/ntcharts.so
|
|
59
|
+
- lib/ntcharts/4.0/ntcharts.so
|
|
60
|
+
- lib/ntcharts/bar_data.rb
|
|
61
|
+
- lib/ntcharts/version.rb
|
|
62
|
+
- ntcharts.gemspec
|
|
63
|
+
homepage: https://github.com/marcoroth/ntcharts-ruby
|
|
64
|
+
licenses:
|
|
65
|
+
- MIT
|
|
66
|
+
metadata:
|
|
67
|
+
homepage_uri: https://github.com/marcoroth/ntcharts-ruby
|
|
68
|
+
source_code_uri: https://github.com/marcoroth/ntcharts-ruby
|
|
69
|
+
changelog_uri: https://github.com/marcoroth/ntcharts-ruby/releases
|
|
70
|
+
rubygems_mfa_required: 'true'
|
|
71
|
+
rdoc_options: []
|
|
72
|
+
require_paths:
|
|
73
|
+
- lib
|
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
|
+
requirements:
|
|
76
|
+
- - ">="
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: '3.2'
|
|
79
|
+
- - "<"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 4.1.dev
|
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: 3.3.22
|
|
87
|
+
requirements: []
|
|
88
|
+
rubygems_version: 4.0.3
|
|
89
|
+
specification_version: 4
|
|
90
|
+
summary: Ruby wrapper for NimbleMarkets' ntcharts terminal charting library.
|
|
91
|
+
test_files: []
|