ant design table how to display empty rows - antd

I'm working with ant design using the Table component and am wondering if there is a way to display 10 rows at all times even if they are empty. For example, I have a data set with 11 items. The page size is set to 10, so the first ten items show on the first page and the last item shows on the second page. But the second page displays only one row and I would like it to display 10 (one with the item and nine empty rows).
How can I go about doing this? Should I be writing a function or is there a prop I can use on the Table component?
This is an example of what my second page looks like currently ^^^
my table component:
import React from 'react';
import { Table } from 'antd';
const columns = [
{
title: 'Asylum Office',
dataIndex: 'asylumOffice',
key: 'asylumOffice',
},
{
title: 'Citizenship',
dataIndex: 'citizenship',
key: 'citizenship',
},
{
title: 'Race or Ethnicity',
dataIndex: 'raceOrEthnicity',
key: 'raceOrEthnicity',
},
{
title: 'Case Outcome',
dataIndex: 'caseOutcome',
key: 'caseOutcome',
},
{
title: 'Completion',
dataIndex: 'completion',
key: 'completion',
},
{
title: 'Current Date',
dataIndex: 'currentDate',
key: 'currentDate',
},
];
const data = [
{
key: '1',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'other',
caseOutcome: 'pending',
completion: 'n',
currentDate: 'f',
},
{
key: '2',
asylumOffice: 'AWS',
citizenship: 'A',
raceOrEthnicity: 'other',
caseOutcome: 'pending',
completion: 'Y',
currentDate: 'e',
},
{
key: '3',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '4',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '5',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '6',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '7',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '8',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '9',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '10',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
{
key: '11',
asylumOffice: 'AyS',
citizenship: 'h',
raceOrEthnicity: 'latino',
caseOutcome: 'pending',
completion: 's',
currentDate: 'f',
},
];
function RenderTablePage(props) {
return (
<div>
<Table
columns={columns}
dataSource={data}
title={() => 'Tabular View'}
/>
</div>
);
}
export default RenderTablePage;

Related

How to draw a Highcharts tree map where sum of children values are not equal to parent value

In a highcharts tree map I know the value of the parent and the values of some children - not of all children.
data:[{ id: 'C1', parent: 'P', value: 25, color: 'blue'},
{ id: 'C2', parent: 'P', value: 35, color: 'yellow'},
{ id: 'P', value: 100, color: 'red'}]
As you can see, there are missing children with a sum of 40.
When I draw this chart, I get P with an area of 100, but the children get enlared to 42 and 58, so they fill the complete area of P. If I omit the value in P, the children are sized correctly, but P has only a size of 60.
The wished result would be P with a size of 100 , and the children with 25 and 35, leaving 40 free (shown red).
The only way I could manage this was some dummy C3 child with the value of (P-C1-C2), but I would prefer not to do this calculation.
Is there a setting I can use? ignoreHiddenPoint: true did not help.
The best approach for that would be to add a hidden point (child), since the tree map calculates the children and accumulates these values at parent.
let Data = [{
id: 'C1',
parent: 'P',
value: 25,
color: 'blue'
},
{
id: 'C2',
parent: 'P',
value: 35,
color: 'yellow'
},
{
id: 'C3',
parent: 'P',
value: 40,
color: 'transparent',
},
{
id: 'P',
value: null,
color: 'red'
}
]
Highcharts.chart('container', {
series: [{
opacity: 1,
type: 'treemap',
layoutAlgorithm: 'strip',
allowDrillToNode: true,
animationLimit: 1000,
dataLabels: {
enabled: false
},
levelIsConstant: true,
levels: [{
level: 1,
dataLabels: {
enabled: true
},
borderWidth: 3
}],
data: Data
}],
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>
<div id="container"></div>
Demo: https://jsfiddle.net/BlackLabel/g81L4xfp/

Highcharts treemap data labels overflow

while using Highcharts multi level treemap I ran into data labels overflow issue. Data labels overflows to other area. This works fine at level 1 & 2 when I use option overflow: 'crop' but does not work at level 3. Any idea where it is going wrong.
Here in example area with name:F data label overflows but data label with name:C at level 2 does not overflow.
Here is fiddle example.
$(function() {
var H = Highcharts;
$('#container').highcharts({
chart: {
type: 'treemap',
width: 500
},
title: {
text: null
},
plotOptions: {
series: {
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top'
}
}, {
level: 2,
dataLabels: {
formatter: function () {
return this.point.realValue;
},
overflow: 'crop'
}
}, {
level: 3,
dataLabels: {
formatter: function () {
return this.point.realValue;
},
overflow: 'crop'
}
}]
}
},
series: [{
data: [{
name: 'A',
id: 'A',
value: 1,
color: '#FFFFFF'
}, {
name: 'B',
id: 'B',
value: 1,
color: '#FFFFFF'
}, {
name: 'C',
parent: 'A',
id: 'A-1',
value: 10,
realValue: 'thisisveryveryveryveryveryverylongteststring',
color: '#ECEA8E'
}, {
name: 'D',
parent: 'A',
id: 'A-2',
color: '#FFFFFF'
}, {
name: 'E',
parent: 'A-2',
id: 'A-2-1',
value: 10,
realValue: 'A',
color: '#599753'
}, {
name: 'F',
parent: 'A-2',
id: 'A-2-2',
value: 10,
realValue: 'thisisveryveryveryverylongteststring',
color: '#1B3C40'
}, {
name: 'G',
parent: 'B',
id: 'B-1',
value: 10,
realValue: 'A',
color: '#ECEA8E'
}, {
name: 'H',
parent: 'B',
id: 'B-2',
color: '#FFFFFF'
}, {
name: 'I',
parent: 'B-2',
id: 'B-2-1',
value: 10,
realValue: 'A',
color: '#599753'
}, {
name: 'J',
parent: 'B-2',
id: 'B-2-2',
value: 10,
realValue: 'A',
color: '#1B3C40'
}]
}]
});
});
Unfortunately, Highcharts doesn't hide labels when they don't fit treemap point area. As a workaround, you can loop through each data point and check if label related to it is wider. If it is wider just hide it.
Code:
chart: {
type: 'treemap',
width: 500,
events: {
load: function() {
var chart = this,
series = chart.series[0],
pointWidth,
labelWidth;
series.data.forEach(function(point) {
if (point.dataLabel) {
pointWidth = point.shapeArgs.width;
labelWidth = point.dataLabel.width;
if (labelWidth > pointWidth) {
point.dataLabel.hide();
}
}
});
}
}
}
Demo:
https://jsfiddle.net/BlackLabel/h65xm4qb/
API reference:
https://api.highcharts.com/class-reference/Highcharts.SVGElement#hide

How to show relation between two boxes containing same data in two different treemaps

I am using treemaps for a comparison purpose. I am using highchart.com for visualization.
I am showing two different treemaps side by side and hence providing a way of comparison for users. I want to link two same boxes in different treemaps. For example, I have two different treemaps and both have word "Bananas" in common. I want that when I hover on Box containing "Bananas" in first treemap, it highlights the same box of "Bananas" in 2nd treemap.
Is this even possible?
here is the code which generates the treemap.
Highcharts.chart('treemap1', {
series: [{
type: "treemap",
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
layoutAlgorithm: 'sliceAndDice',
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top',
style: {
fontSize: '15px',
fontWeight: 'bold'
}
}
}],
data: [{
id: 'A',
name: 'Apples',
color: "#EC2500"
}, {
id: 'B',
name: 'Bananas',
color: "#ECE100"
}, {
id: 'O',
name: 'Oranges',
color: '#EC9800'
}, {
name: 'Anne',
parent: 'A',
value: 5
}, {
name: 'Rick',
parent: 'A',
value: 3
}, {
name: 'Peter',
parent: 'A',
value: 4
}, {
name: 'Anne',
parent: 'B',
value: 4
}, {
name: 'Rick',
parent: 'B',
value: 10
}, {
name: 'Peter',
parent: 'B',
value: 1
}, {
name: 'Anne',
parent: 'O',
value: 1
}, {
name: 'Rick',
parent: 'O',
value: 3
}, {
name: 'Peter',
parent: 'O',
value: 3
}, {
name: 'Susanne',
parent: 'Kiwi',
value: 2,
color: '#9EDE00'
}]
}],
title: {
text: 'Treemap 1'
}
});
Highcharts.chart('treemap2', {
series: [{
type: "treemap",
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
layoutAlgorithm: 'sliceAndDice',
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top',
style: {
fontSize: '15px',
fontWeight: 'bold'
}
}
}],
data: [{
id: 'A',
name: 'Apples',
color: "#EC2500"
}, {
id: 'B',
name: 'Bananas',
color: "#ECE100"
}, {
id: 'O',
name: 'Oranges',
color: '#EC9800'
}, {
name: 'Anne',
parent: 'A',
value: 5
}, {
name: 'Rick',
parent: 'A',
value: 3
}, {
name: 'Peter',
parent: 'A',
value: 4
}, {
name: 'Anne',
parent: 'B',
value: 4
}, {
name: 'Rick',
parent: 'B',
value: 10
}, {
name: 'Peter',
parent: 'B',
value: 1
}, {
name: 'Anne',
parent: 'O',
value: 1
}, {
name: 'Rick',
parent: 'O',
value: 3
}, {
name: 'Peter',
parent: 'O',
value: 3
}, {
name: 'Susanne',
parent: 'Kiwi',
value: 2,
color: '#9EDE00'
}]
}],
title: {
text: 'Treemap 2'
}
});
.treemap-chart {
float: left;
width: 50%
}
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>
<div id="treemap1" class="treemap-chart"></div>
<div id="treemap2" class="treemap-chart"></div>
Image of the output here:
codeoutput
You can do this by setting the state of a the hovered point in the mouseOver event and removing the state in the mouseOut event. Like this for the first chart, and the same for second chart changing the variable chart2 to chart1:
plotOptions: {
series: {
point: {
events: {
mouseOver: function(event) {
for (var i = 0; i < chart2.series[0].data.length; i++) {
if (chart2.series[0].data[i].name == event.target.name && chart2.series[0].data[i].parent == event.target.parent) {
chart2.series[0].data[i].setState('hover')
}
}
},
mouseOut: function(event) {
for (var i = 0; i < chart2.series[0].data.length; i++) {
if (chart2.series[0].data[i].name == event.target.name && chart2.series[0].data[i].parent == event.target.parent) {
chart2.series[0].data[i].setState('')
}
}
}
}
}
}
},
var chart1 = Highcharts.chart('treemap1', {
plotOptions: {
series: {
point: {
events: {
mouseOver: function(event) {
for (var i = 0; i < chart2.series[0].data.length; i++) {
if (chart2.series[0].data[i].name == event.target.name && chart2.series[0].data[i].parent == event.target.parent) {
chart2.series[0].data[i].setState('hover')
}
}
},
mouseOut: function(event) {
for (var i = 0; i < chart2.series[0].data.length; i++) {
if (chart2.series[0].data[i].name == event.target.name && chart2.series[0].data[i].parent == event.target.parent) {
chart2.series[0].data[i].setState('')
}
}
}
}
}
}
},
series: [{
type: "treemap",
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
layoutAlgorithm: 'sliceAndDice',
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top',
style: {
fontSize: '15px',
fontWeight: 'bold'
}
}
}],
data: [{
id: 'A',
name: 'Apples',
color: "#EC2500"
}, {
id: 'B',
name: 'Bananas',
color: "#ECE100"
}, {
id: 'O',
name: 'Oranges',
color: '#EC9800'
}, {
name: 'Anne',
parent: 'A',
value: 5
}, {
name: 'Rick',
parent: 'A',
value: 3
}, {
name: 'Peter',
parent: 'A',
value: 4
}, {
name: 'Anne',
parent: 'B',
value: 4
}, {
name: 'Rick',
parent: 'B',
value: 10
}, {
name: 'Peter',
parent: 'B',
value: 1
}, {
name: 'Anne',
parent: 'O',
value: 1
}, {
name: 'Rick',
parent: 'O',
value: 3
}, {
name: 'Peter',
parent: 'O',
value: 3
}, {
name: 'Susanne',
parent: 'Kiwi',
value: 2,
color: '#9EDE00'
}]
}],
title: {
text: 'Treemap 1'
}
});
var chart2 = Highcharts.chart('treemap2', {
plotOptions: {
series: {
point: {
events: {
mouseOver: function(event) {
for (var i = 0; i < chart1.series[0].data.length; i++) {
if (chart1.series[0].data[i].name == event.target.name && chart1.series[0].data[i].parent == event.target.parent) {
chart1.series[0].data[i].setState('hover')
}
}
},
mouseOut: function(event) {
for (var i = 0; i < chart1.series[0].data.length; i++) {
if (chart1.series[0].data[i].name == event.target.name && chart1.series[0].data[i].parent == event.target.parent) {
chart1.series[0].data[i].setState('')
}
}
}
}
}
}
},
series: [{
type: "treemap",
layoutAlgorithm: 'stripes',
alternateStartingDirection: true,
levels: [{
level: 1,
layoutAlgorithm: 'sliceAndDice',
dataLabels: {
enabled: true,
align: 'left',
verticalAlign: 'top',
style: {
fontSize: '15px',
fontWeight: 'bold'
}
}
}],
data: [{
id: 'A',
name: 'Apples',
color: "#EC2500"
}, {
id: 'B',
name: 'Bananas',
color: "#ECE100"
}, {
id: 'O',
name: 'Oranges',
color: '#EC9800'
}, {
name: 'Anne',
parent: 'A',
value: 5
}, {
name: 'Rick',
parent: 'A',
value: 3
}, {
name: 'Peter',
parent: 'A',
value: 4
}, {
name: 'Anne',
parent: 'B',
value: 4
}, {
name: 'Rick',
parent: 'B',
value: 10
}, {
name: 'Peter',
parent: 'B',
value: 1
}, {
name: 'Anne',
parent: 'O',
value: 1
}, {
name: 'Rick',
parent: 'O',
value: 3
}, {
name: 'Peter',
parent: 'O',
value: 3
}, {
name: 'Susanne',
parent: 'Kiwi',
value: 2,
color: '#9EDE00'
}]
}],
title: {
text: 'Treemap 2'
}
});
.treemap-chart {
float: left;
width: 50%
}
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>
<div id="treemap1" class="treemap-chart"></div>
<div id="treemap2" class="treemap-chart"></div>
Working jsfiddle example: https://jsfiddle.net/ewolden/czn1rjxu/2/

Treemap with Multiple Series

I am trying to create TreeMap with multiple series, the series are getting plotted on the graph with both series clubbed together, but I want only one series to be displayed at a time. Basically legand can be used but for treemap it's showing values.
This is the jsfiddle I am trying to work on
JavaScript files used
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/heatmap.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>
<div id="container"></div>
The treemap should be updated as per the series selected.
Highchart Bound Using
Highcharts.chart('container', {
colorAxis: {
minColor: '#FFFFFF',
maxColor: Highcharts.getOptions().colors[0]
},
legend: {
enabled: true,
},
series: [{
name:"Series 1",
stack: 'aeroplanes',
type: 'treemap',
layoutAlgorithm: 'squarified',
data: [{
name: 'A -Series 1',
value: 6,
colorValue: 1
}, {
name: 'B -Series 1',
value: 6,
colorValue: 2
}, {
name: 'C -Series 1',
value: 4,
colorValue: 3
}, {
name: 'D -Series 1',
value: 3,
colorValue: 4
}, {
name: 'E -Series 1',
value: 2,
colorValue: 5
}, {
name: 'F -Series 1',
value: 2,
colorValue: 6
}, {
name: 'G -Series 1',
value: 1,
colorValue: 7
}]
},
// Second Series
{
name:"Series 2",
type: 'treemap',
stack: 'aeroplanes2',
layoutAlgorithm: 'squarified',
visible:true,
data: [{
name: 'AA -Series 2',
value: 16,
colorValue: 2
}, {
name: 'BB -Series 2',
value: 26,
colorValue: 2
}, {
name: 'Cc -Series 2',
value: 14,
colorValue: 2
}, {
name: 'Dd -Series 2',
value: 13,
colorValue: 2
}, {
name: 'Ee -Series 2',
value: 12,
colorValue: 2
}, {
name: 'Ff -Series 2',
value: 12,
colorValue: 2
}, {
name: 'Gg -Series 2',
value: 11,
colorValue: 2
}]
}],
title: {
text: 'Highcharts Treemap'
},
plotOptions: {
treemap: {
stacking: 'percent'
}
},
});
By default showInLegend equals to false for treemap series - it needs to be enabled manually. In legendItemClick event I handled series visibility toggling:
plotOptions: {
treemap: {
showInLegend: true,
events: {
legendItemClick: function() {
this.chart.series.forEach((s) => s.setVisible());
return false;
}
}
}
}
Live demo: http://jsfiddle.net/kkulig/0n49vv74/
API references:
https://api.highcharts.com/highcharts/plotOptions.treemap.events.legendItemClick
https://api.highcharts.com/highcharts/plotOptions.treemap.showInLegend
https://api.highcharts.com/class-reference/Highcharts.Series#setVisible

How to set time range for datebox

I am trying to set a time range (e.g. from 9am to 3pm only). So far, I have only been able to set the default time.
$('#time').trigger('datebox', {"method":"set", "value":"06:00 PM"});
Indeed, it is not supported in DateBox1 - it is however supported in DateBox2: http://dev.jtsage.com/jQM-DateBox2/demos/opt/limit.html (jquery 1.7.1+ is required for this version at this time) (and it is still pretty beta, but it's reasonably solid).
Sorry, it isn't supported. It looks like days and years are the only thing that support a min and max. This probably wouldn't be difficult to add to the code if you fork his repo.
You can view all options, documented and undocumented, by looking at the source on github https://github.com/jtsage/jquery-mobile-datebox/blob/master/js/jquery.mobile.datebox.js
options: {
// All widget options, including some internal runtime details
version: '1.0.1-2012022700', // jQMMajor.jQMMinor.DBoxMinor-YrMoDaySerial
theme: false,
defaultTheme: 'c',
pickPageTheme: 'b',
pickPageInputTheme: 'e',
pickPageButtonTheme: 'a',
pickPageHighButtonTheme: 'e',
pickPageOHighButtonTheme: 'e',
pickPageOAHighButtonTheme: 'e',
pickPageODHighButtonTheme: 'e',
pickPageTodayButtonTheme: 'e',
pickPageSlideButtonTheme: 'd',
pickPageFlipButtonTheme: 'b',
forceInheritTheme: false,
centerWindow: false,
calHighToday: true,
calHighPicked: true,
transition: 'pop',
noAnimation: false,
disableManualInput: false,
disabled: false,
wheelExists: false,
swipeEnabled: true,
zindex: '500',
debug: false,
clickEvent: 'vclick',
numberInputEnhance: true,
internalInputType: 'text',
resizeListener: true,
titleDialogLabel: false,
meridiemLetters: ['AM', 'PM'],
timeOutputOverride: false,
timeFormats: { '12': '%l:%M %p', '24': '%k:%M' },
durationFormat: 'DD ddd, hh:ii:ss',
timeOutput: false,
rolloverMode: { 'm': true, 'd': true, 'h': true, 'i': true, 's': true },
mode: 'datebox',
calShowDays: true,
calShowOnlyMonth: false,
useDialogForceTrue: false,
useDialogForceFalse: true,
fullScreen: false,
fullScreenAlways: false,
useDialog: false,
useModal: false,
useInline: false,
useInlineBlind: false,
useClearButton: false,
collapseButtons: false,
noButtonFocusMode: false,
focusMode: false,
noButton: false,
noSetButton: false,
openCallback: false,
openCallbackArgs: [],
closeCallback: false,
closeCallbackArgs: [],
open: false,
nestedBox: false,
lastDuration: false,
fieldsOrder: false,
fieldsOrderOverride: false,
durationOrder: ['d', 'h', 'i', 's'],
defaultDateFormat: '%Y-%m-%d',
dateFormat: false,
timeFormatOverride: false,
headerFormat: false,
dateOutput: false,
minuteStep: 1,
calTodayButton: false,
calWeekMode: false,
calWeekModeFirstDay: 1,
calWeekModeHighlight: true,
calStartDay: false,
defaultPickerValue: false,
defaultDate : false, //this is deprecated and will be removed in the future versions (ok, may be not)
minYear: false,
maxYear: false,
afterToday: false,
beforeToday: false,
maxDays: false,
minDays: false,
highDays: false,
highDates: false,
highDatesAlt: false,
blackDays: false,
blackDates: false,
enableDates: false,
fixDateArrays: false,
durationSteppers: {'d': 1, 'h': 1, 'i': 1, 's': 1},
useLang: 'en',
lang: {
'en' : {
setDateButtonLabel: 'Set Date',
setTimeButtonLabel: 'Set Time',
setDurationButtonLabel: 'Set Duration',
calTodayButtonLabel: 'Jump to Today',
titleDateDialogLabel: 'Set Date',
titleTimeDialogLabel: 'Set Time',
daysOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
daysOfWeekShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
monthsOfYear: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
monthsOfYearShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
durationLabel: ['Days', 'Hours', 'Minutes', 'Seconds'],
durationDays: ['Day', 'Days'],
timeFormat: 24,
headerFormat: '%A, %B %-d, %Y',
tooltip: 'Open Date Picker',
nextMonth: 'Next Month',
prevMonth: 'Previous Month',
dateFieldOrder: ['m', 'd', 'y'],
timeFieldOrder: ['h', 'i', 'a'],
slideFieldOrder: ['y', 'm', 'd'],
dateFormat: '%Y-%m-%d',
useArabicIndic: false,
isRTL: false,
calStartDay: 0,
clearButton: 'Clear'
}
}
}

Resources