Download the PHP package shortdark/socket without Composer

On this page you can find all versions of the php package shortdark/socket. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package socket

Shortdark/Socket

Shortdark/Socket creates an SVG line graph from and array of up to 10 series of date-based data. This version currently assumes that the data will be from week days only, i.e. it expects not to have any data from weekends. Public holidays should be included in the array. Null values are not represented by a line, graph lines that contain null values will have gaps. More than 10 lines are possible on the graph if the extra line colors are specified manually.

Installation

Basic Usage

Data Array

Representing A Range Of Values

If you have two lines that are the min and max values, and you want to represent them as a range on the graph, i.e. between the two lines is filled with color, you can make the variable true.

Data Points Array

Optional Customization

Defaults are shown, below. Each of these variables can be altered, if desired.

You can modify any/all the above like so...

$socket = new Shortdark\Socket;

// Change the width of the SVG
$socket->width_of_svg = 1000;

// Change the height of the SVG
$socket->height_of_svg = 500;

// The number of horizontal lines
$socket->iterations = 10;

// The color of each line
$socket->colors = [
    'col1' => 'blue',
    'col2' => 'green',
    'col3' => 'orange',
    'col4' => 'red'
];

// Whether to show the week number from the start of the year (every fifth week: 5, 10...)
$socket->show_week_numbers = true;

// The dates for the x-axis must be in the format YYY-mm-dd, but do we want to display the year?
$socket->show_year_xaxis = false;

// Which month format to display on the x-axis
$socket->month_format = 'letter'; // 'none', 'letter', 'short', or 'long'

// Optional, show a legends box to describe each graphline
$socket->show_legend_box = true;

// Optional, legends box, specify the width of the box
$socket->legend_box_width = 150;

// Give each graph line a label in the "legends box"
$socket->legends = [
    'col1' => 'This is column 1',
    'col2' => 'The second column',
    'col3' => 'Third',
    'col4' => 'Lastly... another'
];
$socket->graph_name = 'Something vs. Something else vs Another';
$socket->show_last_value_in_legend = true;
$socket->legend_pre_value = '$';
$socket->legend_post_value = '%';

// The text/link in the bottom right hand corner
$socket->branding_text = 'Shortdark Web Dev';
$socket->branding_url = 'https://shortdark.co.uk';
$socket->brand_x_from_right = 0;
$socket->brand_y_from_bottom = 0;

// Representing two lines as a range, i.e. the space between the two lines is filled
$socket->filled_lines = false;

// Generally the graph starts/ends at a multiple of 10, the nearest value would be the nearest number above or below the max/min value.
$socket->nearest_value = false;

echo $socket->draw_svg($dataArray);

Author

Neil Ludlow - https://shortdark.co.uk


All versions of socket with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shortdark/socket contains the following files

Loading the files please wait ....