| Income taxes - Reconciliation of Deferred Tax Assets and Liabilities (Details) - USD ($) $ in Thousands | Dec. 31, 2018 | Dec. 31, 2017 | 
|---|---|---|
| Deferred tax liabilities | ||
| Property, plant and equipment | $ (1,415) | $ (2,159) | 
| Accruals | (3) | |
| Deferred tax liabilities | (1,415) | (2,162) | 
| Deferred tax assets | ||
| Share-based compensation expense | 8,020 | 5,603 | 
| Intangibles | 575 | 381 | 
| Other | 286 | 254 | 
| Net operating loss and expenditure credit carryforwards | 33,310 | 23,357 | 
| Deferred tax assets | 42,191 | 29,595 | 
| Valuation allowance | (40,776) | (27,433) | 
| Deferred tax assets, net | $ 1,415 | $ 2,162 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from intangible assets. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible operating loss carryforwards and deductible tax credit carryforwards. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences and carryforwards. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount after allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences and carryforwards. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before allocation of valuation allowances of deferred tax asset attributable to deductible temporary differences from share-based compensation. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount, before allocation of valuation allowance, of deferred tax asset attributable to deductible temporary differences from reserves and accruals, classified as other. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax assets for which it is more likely than not that a tax benefit will not be realized. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences from reserves and accruals. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred tax liability attributable to taxable temporary differences from property, plant, and equipment. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 |